From a35078f5fe5bdc06e69dfe296f625d0c085a2e6c Mon Sep 17 00:00:00 2001 From: Rene Rebe Date: Fri, 29 Aug 2003 23:26:17 +0000 Subject: [PATCH] Tobias C. Rittweiler: improved missing binary check and Build-Pkg argument parsing Rene Rene: improved Build-Pkg argument parsing further git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1250 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- Documentation/Developers/CHANGELOG-RENE | 3 +++ scripts/Build-Pkg | 18 +++++++++++++----- scripts/Build-Target | 8 ++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Documentation/Developers/CHANGELOG-RENE b/Documentation/Developers/CHANGELOG-RENE index a7219367b..6ad807ba6 100644 --- a/Documentation/Developers/CHANGELOG-RENE +++ b/Documentation/Developers/CHANGELOG-RENE @@ -4,6 +4,9 @@ - added bash version checkk to System-Check - Daniel Jahre: merged first parts for realtime (RTAI) support - Alan J. Wylie: added libmcrypt + - Tobias C. Rittweiler: improved missing binary check and Build-Pkg argument + parsing + - improved Build-Pkg argument parsing further *) 2003-08-29 (2.0.0-rc1 - 2.0.0-rc2) diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index 1ab4d05c7..5787a65d1 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -45,12 +45,12 @@ root="" id='' stagelevel=9 +this_is_the_2nd_run=0 # # ---- Functions # -. scripts/functions help_msg() { spacer=" " @@ -73,7 +73,10 @@ help_msg() { # ---- Parse options + config and make Build-Pkg sub-calls # -this_is_the_2nd_run=0 + +if [ -z "$1" ] ; then + help_msg ; exit 1 +fi while [ "$1" ] ; do case "$1" in @@ -99,6 +102,12 @@ while [ "$1" ] ; do shift done +# check if arguments are left as package names +if [ $# = 0 ] ; then + help_msg ; exit 1 +fi + +. ./scripts/functions . ./scripts/parse-config if [ -z "$root" -a $stagelevel -le 1 ] || \ @@ -120,9 +129,8 @@ fi ./scripts/Build-Tools -$stagelevel -cfg $config || exit 1 -if [ -z "$1" ] ; then - help_msg ; exit 1 -elif [ "$2" ] ; then +# more than one package are passed +if [ $# -gt 1 ] ; then for x ; do if ! ./scripts/Build-Pkg $options $x && \ [ "$ROCKCFG_ABORT_ON_ERROR" = 1 ] ; then diff --git a/scripts/Build-Target b/scripts/Build-Target index 4c4972173..c7b8a7200 100755 --- a/scripts/Build-Target +++ b/scripts/Build-Target @@ -202,10 +202,10 @@ fi cut -d' ' -f5 fi > $pkglst for x in `cat $pkglst` ; do - if ! [ $ROCKCFG_CREATE_TARBZ2 = 0 -o \ - -e build/$ROCKCFG_ID/pkgs/$x.tar.bz2 ] || - ! [ $ROCKCFG_CREATE_GEM = 0 -o \ - -e build/$ROCKCFG_ID/pkgs/$x.gem ] + if [ $ROCKCFG_CREATE_TARBZ2 = 1 -a \ + ! -s build/$ROCKCFG_ID/pkgs/$x.tar.bz2 ] || + [ $ROCKCFG_CREATE_GEM = 1 -a \ + ! -s build/$ROCKCFG_ID/pkgs/$x.gem ] then x="build/$ROCKCFG_ID/pkgs/$x" echo_error "Binary package $x is missing!"