From 1ba1619bad611ba86570854a9fabf3d03a26b848 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <art1@andreas-romeyke.de> Date: Wed, 24 Mar 2021 10:13:17 +0100 Subject: [PATCH] - init, added a bash script to bundle required perl-module with script --- build_par_file.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 build_par_file.sh diff --git a/build_par_file.sh b/build_par_file.sh new file mode 100644 index 0000000..9ec8bb3 --- /dev/null +++ b/build_par_file.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Script to bundle Perl-Module with Script +# by Andreas Romeyke @ SLUB Dresden +REQUIRED_PERL_MODULE=PAR::Packer +WHAT_TO_BUNDLE=bin/slubsipbuilderbagit.pl +BUNDLE_NAME=slubsipbuilder_bundled.pl +BUNDLE_LOG=bundle.log +echo -n "Checking if required module exists… " +# test if module exists +perl -M${REQUIRED_PERL_MODULE} -e ";" > /dev/null 2>&1 +if [[ $? -ne 0 ]]; then + echo "failed! :(" + echo "you need to install perl module ${REQUIRED_PERL_MODULE}"; + echo "HINT: 'cpanm ${REQUIRED_PERL_MODULE}' could help"; + exit 1; +else + echo "fine :)" +fi +echo -n "Trying to bundle… " +# -c .... check dependencies via 'perl -c ...' +# -P .... build a Perl-script bundle +# -o .... output as +pp -c -P -o ${BUNDLE_NAME} ${WHAT_TO_BUNDLE} > ${BUNDLE_LOG} 2>&1 +if [[ $? -eq 0 ]]; then + echo "fine :)" + echo "Successfully build bundles in ${BUNDLE_NAME}" + rm -f ${BUNDLE_LOG} +else + echo "failed! :'(" + echo "Something was wrong in bundling to ${BUNDLE_NAME}" + echo "Check ${BUNDLE_LOG} for details" +fi + -- GitLab