tazwok rev 397 4.3
Use a variable for cook-order.txt, and move this file to packages-incoming (4.3)
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Thu Mar 03 21:50:40 2011 +0100 (2011-03-03) |
parents | 0552e3ee4587 |
children | 12826f6ad117 |
files | tazwok |
line diff
1.1 --- a/tazwok Fri Mar 04 02:53:20 2011 +0100 1.2 +++ b/tazwok Thu Mar 03 21:50:40 2011 +0100 1.3 @@ -117,6 +117,7 @@ 1.4 # Basically, get theses files from the net if they are missing. 1.5 dep_db=$INCOMING_REPOSITORY/wok-depends.txt 1.6 wan_db=$INCOMING_REPOSITORY/wok-wanted.txt 1.7 + cookorder=$INCOMING_REPOSITORY/cookorder.txt 1.8 1.9 # Check commons directories, create them if user is root. 1.10 if test $(id -u) = 0 ; then 1.11 @@ -128,7 +129,7 @@ 1.12 check_dir $LOCAL_REPOSITORY/log 1.13 [ -f $dep_db ] || touch $dep_db 1.14 [ -f $wan_db ] || touch $wan_db 1.15 - [ -f $PACKAGES_REPOSITORY/cookorder.txt ] || touch $PACKAGES_REPOSITORY/cookorder.txt 1.16 + [ -f $cookorder ] || touch $cookorder 1.17 for file in broken blocked commit incoming cooklist; do 1.18 [ ! -f $PACKAGES_REPOSITORY/$file ] && touch $PACKAGES_REPOSITORY/$file 1.19 done 1.20 @@ -1226,14 +1227,14 @@ 1.21 echo "Removing $PACKAGE from $pkg_repository." 1.22 rm $pkg 1.23 [ -d $WOK/$PACKAGE ] && rm -r $WOK/$PACKAGE 1.24 - sed "/^$PACKAGE\t/d" -i $wan_db $dep_db 1.25 - for i in cookorder.txt cooklist commit blocked broken; do 1.26 + sed "/^$PACKAGE\t/d" -i $wan_db $dep_db $cookorder 1.27 + for i in cooklist commit blocked broken; do 1.28 sed "/^$PACKAGE$/d" -i $PACKAGES_REPOSITORY/$i 1.29 done 1.30 rm -f $LOCAL_REPOSITORY/log/$PACKAGE.html 1.31 if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ] && \ 1.32 - [ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" != "#PlanSort" ] ; then 1.33 - sed 1i"#PlanSort" -i $PACKAGES_REPOSITORY/cookorder.txt 1.34 + [ "$(sed 1!d $cookorder)" != "#PlanSort" ] ; then 1.35 + sed 1i"#PlanSort" -i $cookorder 1.36 regen_cooklist=yes 1.37 else 1.38 echo "$PACKAGE" >> $PACKAGES_REPOSITORY/removed 1.39 @@ -1383,7 +1384,7 @@ 1.40 report step "Generating wok database" 1.41 report open-bloc 1.42 report step "Removing old files" 1.43 - for file in $wan_db $dep_db $PACKAGES_REPOSITORY/cookorder.txt; do 1.44 + for file in $wan_db $dep_db $cookorder; do 1.45 [ -f $file ] && rm $file 1.46 done 1.47 report step "Generating wok-wanted.txt" 1.48 @@ -1487,12 +1488,12 @@ 1.49 # The toolchain packages are moved in first position. 1.50 grep $(for pkg in `scan "$SLITAZ_TOOLCHAIN $SLITAZ_TOOLCHAIN_EXTRA" \ 1.51 --look_for=all --with_args`; do echo " -e ^$pkg$"; done) \ 1.52 - $tmp/cookorder | tac > $PACKAGES_REPOSITORY/cookorder.txt 1.53 - for pkg in $(cat $PACKAGES_REPOSITORY/cookorder.txt); do 1.54 + $tmp/cookorder | tac > $cookorder 1.55 + for pkg in $(cat $cookorder); do 1.56 sed "/^$pkg$/d" -i $tmp/cookorder 1.57 done 1.58 1.59 - tac $tmp/cookorder >> $PACKAGES_REPOSITORY/cookorder.txt 1.60 + tac $tmp/cookorder >> $cookorder 1.61 unset plan_regen_cookorder 1.62 report end-step 1.63 } 1.64 @@ -1737,9 +1738,8 @@ 1.65 [ "$plan_sort_depdb" ] && sort -o $dep_db $dep_db && unset plan_sort_depdb 1.66 [ "$plan_sort_wandb" ] && sort -o $wan_db $wan_db && unset plan_sort_wandb 1.67 if [ "$plan_regen_cookorder" ] && \ 1.68 - [ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" != "#PlanSort" ]; then 1.69 - grep -q "^#" $PACKAGES_REPOSITORY/cookorder.txt || \ 1.70 - sed 1i"#PlanSort" -i $PACKAGES_REPOSITORY/cookorder.txt 1.71 + [ "$(sed 1!d $cookorder)" != "#PlanSort" ]; then 1.72 + grep -q "^#" $cookorder || sed 1i"#PlanSort" -i $cookorder 1.73 fi 1.74 fi 1.75 } 1.76 @@ -1876,8 +1876,8 @@ 1.77 1.78 sort_cooklist() 1.79 { 1.80 - if [ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" = "#PlanSort" ]; then 1.81 - sed 1d -i $PACKAGES_REPOSITORY/cookorder.txt 1.82 + if [ "$(sed 1!d $cookorder)" = "#PlanSort" ]; then 1.83 + sed 1d -i $cookorder 1.84 plan_regen_cookorder=yes 1.85 fi 1.86 [ "$plan_sort_depdb" ] && sort -o $dep_db $dep_db && unset plan_sort_depdb 1.87 @@ -1911,7 +1911,7 @@ 1.88 1.89 # Use cookorder.txt to sort cooklist. 1.90 if [ -s $tmp/cooklist ]; then 1.91 - cat $PACKAGES_REPOSITORY/cookorder.txt | while read PACKAGE; do 1.92 + cat $cookorder | while read PACKAGE; do 1.93 if grep -q ^$PACKAGE$ $tmp/cooklist; then 1.94 sed "/^$PACKAGE$/d" -i $tmp/cooklist 1.95 echo $PACKAGE >> $tmp/cooklist.tmp 1.96 @@ -2630,8 +2630,8 @@ 1.97 [ "$plan_sort_depdb" ] && sort -o $dep_db $dep_db && unset plan_sort_depdb 1.98 [ "$plan_sort_wandb" ] && sort -o $wan_db $wan_db && unset plan_sort_wandb 1.99 if [ "$plan_regen_cookorder" ]; then 1.100 - [ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" = "#PlanSort" ] || \ 1.101 - sed 1i"#PlanSort" -i $PACKAGES_REPOSITORY/cookorder.txt 1.102 + [ "$(sed 1!d $cookorder)" = "#PlanSort" ] || \ 1.103 + sed 1i"#PlanSort" -i $cookorder 1.104 fi 1.105 cook 1.106 ;;