From 2ecab0d39d5004bfddad7f3a9f23ed6ed3d56a4e Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 17 Aug 2004 14:42:54 +0000 Subject: [PATCH] Clifford Wolf: Added -stages parameter to Build-Target and Create-PkgQueue [2004081418111318967] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@3899 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- scripts/Build-Target | 10 +++++++--- scripts/Create-PkgQueue | 12 ++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/Build-Target b/scripts/Build-Target index 0123c5b78..2cbf2ab34 100755 --- a/scripts/Build-Target +++ b/scripts/Build-Target @@ -34,17 +34,19 @@ config=default build_only_this_job= +stages=0123456789 daemon_mode=0 options="$*" while [ "$1" ] ; do case "$1" in -cfg) config=$2 ; shift ; shift ;; + -stages) stages=$2 ; shift ; shift ;; -job) build_only_this_job=$2 ; shift ; shift ;; -daemon) daemon_mode=1 ; shift ;; -nodaemon) daemon_mode=0 ; shift ;; *) echo "Usage: $0 [ -daemon ] [ -cfg ]" \ - "[ -job - ]" + "[ -stages ] [ -job - ]" echo echo " Compile/build all packages for a given configuration and store them as tar" echo " balls suitable for distribution." @@ -55,6 +57,7 @@ while [ "$1" ] ; do echo echo " -cfg the build configuration to use; defaults to 'default'" echo " -daemon run as daemon in the background" + echo " -stages only build the stages listed in the parameter" echo " -job - build only one job: the given package" echo " in the given stage" exit 1 ;; @@ -162,7 +165,8 @@ in the right way, the nodes will automatically start building the jobs. done if [ "$newqueue" = 1 ] ; then - ./scripts/Create-PkgQueue -cfg $config \ + ./scripts/Create-PkgQueue \ + -cfg $config -stages $stages \ $nobrokendeps | sort -r -n -k2 | \ if [ $ROCKCFG_PARALLEL_MAX -gt 0 ] then head -n $ROCKCFG_PARALLEL_MAX @@ -217,7 +221,7 @@ fi else while next="`./scripts/Create-PkgQueue \ - -cfg "$config" -single $nobrokendeps`" + -cfg "$config" -stages $stages -single $nobrokendeps`" [ "$next" ] do pkgloop_package $next diff --git a/scripts/Create-PkgQueue b/scripts/Create-PkgQueue index d83aa04a4..c55856cc7 100755 --- a/scripts/Create-PkgQueue +++ b/scripts/Create-PkgQueue @@ -26,12 +26,15 @@ config=default logdir="" single=0 debug=0 +stages=0123456789 nobrokendeps=0 while [ "$1" ] ; do case "$1" in -cfg) config=$2 ; shift ; shift ;; + -stages) + stages=$2 ; shift ; shift ;; -single) single=1 ; shift ;; -logdir) @@ -41,8 +44,8 @@ while [ "$1" ] ; do -nobrokendeps) nobrokendeps=1 ; shift ;; *) - echo "Usage: $0 [ -cfg config ] [ -single ] \\" - echo " ${0//?/ } [ -logdir logdir ] [ -debug ]" + echo "Usage: $0 [ -cfg config ] [ -stages ] [ -single ] \\" + echo " ${0//?/ } [ -logdir ] [ -debug ]" exit 1 ;; esac done @@ -52,7 +55,7 @@ done gawk ' function check_package() { split(pkgline, a); dep=a[2]; - if ( a[1] != "X" || ! index(a[2], stagelevel) ) return; + if ( a[1] != "X" || !index(a[2], stagelevel) ) return; repository = a[4]; package = a[5]; @@ -178,7 +181,7 @@ BEGIN { stage01_not_present=0; stage9_no_deps=9; - nobrokendeps='$nobrokendeps'; + nobrokendeps='$nobrokendeps'; stages="'$stages'"; config="'$config'"; single='$single'; debug='$debug'; logdir="'"${logdir:-build/$ROCKCFG_ID/var/adm/logs}"'"; @@ -191,6 +194,7 @@ BEGIN { close(depdb_file); for (stagelevel=0; stagelevel<=9; stagelevel++) { + if ( !index(stages, stagelevel) ) continue; while ( (getline pkgline < packages_file) > 0 ) { check_package(); }