From: Javier Fernández-Sanguino Date: Wed, 3 Apr 2013 18:45:08 +0000 (+0000) Subject: Check that all binaries needed are installed before running X-Git-Tag: 20130928~90 X-Git-Url: http://git.projectaon.org/?p=project-aon.git;a=commitdiff_plain;h=a4c3bd0c18d02eedde304a0a911bf8f398d72948 Check that all binaries needed are installed before running git-svn-id: https://projectaon.org/data/trunk@2220 f6f3e2d7-ff33-0410-aaf5-b4bee2cdac11 --- diff --git a/common/scripts/gbtoepub.pl b/common/scripts/gbtoepub.pl index 5b5d572..cd25611 100755 --- a/common/scripts/gbtoepub.pl +++ b/common/scripts/gbtoepub.pl @@ -21,6 +21,17 @@ my $XALAN_JAR = '/usr/share/java/xalan2.jar'; my $RM = '/bin/rm'; my $CHMOD = '/bin/chmod'; +# Check that all the binaries are were want them + +my @BINARIES; +push @BINARIES, ($RXP, $CP, $MV, $TAR, $ZIP, $BZIP2, $JAVA, $XALAN_JAR, $RM, $CHMOD); + +foreach (@BINARIES) { + if ( ! -e $_ ) { + die "$PROGRAM_NAME: Cannot find binary '".$_."'. Please install it.\n"; + } +} + ### my $EPUB_MIMETYPE = 'application/epub+zip';