Skip to content
Snippets Groups Projects
Commit 1ba1619b authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- init, added a bash script to bundle required perl-module with script

parent 094d8ec5
No related branches found
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment