cookutils rev 32
cooker: finalize reverse command
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri May 06 17:36:35 2011 +0200 (2011-05-06) |
parents | 62fa13d02142 |
children | 62bf9ac888b1 |
files | cook cooker |
line diff
1.1 --- a/cook Fri May 06 17:05:53 2011 +0200 1.2 +++ b/cook Fri May 06 17:36:35 2011 +0200 1.3 @@ -396,6 +396,7 @@ 1.4 # ERROR can be echoed any time in cookit() 1.5 if grep -q ^ERROR $LOGS/$pkg.log; then 1.6 debug_info | tee -a $LOGS/$pkg.log 1.7 + rm -f $command 1.8 exit 1 1.9 fi 1.10 } 1.11 @@ -481,10 +482,11 @@ 1.12 # Verify package quality and consitensy. 1.13 packit_quality() { 1.14 if grep -q ^ERROR $LOGS/$pkg.log; then 1.15 - exit 1 1.16 + rm -f $command && exit 1 1.17 fi 1.18 if ! grep -q ^/ $WOK/$pkg/taz/$pkg-*/files.list; then 1.19 - echo -e "ERROR: empty package\n" | tee -a $LOGS/$pkg.log && exit 1 1.20 + echo -e "ERROR: empty package\n" | tee -a $LOGS/$pkg.log 1.21 + rm -f $command && exit 1 1.22 else 1.23 mv -f $WOK/$pkg/taz/$pkg-*.tazpkg $PKGS 1.24 sed -i /^${pkg}$/d $broken 1.25 @@ -496,7 +498,7 @@ 1.26 # 1.27 1.28 case "$1" in 1.29 - usage|help) 1.30 + usage|help|-u|-h) 1.31 usage ;; 1.32 list-wok) 1.33 gettext "List of packages in:"; echo " $WOK"
2.1 --- a/cooker Fri May 06 17:05:53 2011 +0200 2.2 +++ b/cooker Fri May 06 17:36:35 2011 +0200 2.3 @@ -250,19 +250,27 @@ 2.4 # Use hg commit ? Ex: hg commit -m "Message bla bla | cooker:reverse" 2.5 # 2.6 pkg="$2" 2.7 - [ ! -d "$wok/$pkg" ] && echo "No package $2 found." && exit 0 2.8 - cd $wok 2.9 + [ ! -d "$wok/$pkg" ] && echo -e "\nNo package $2 found.\n" && exit 0 2.10 + rm -f $cooklist && touch $cooklist && cd $wok 2.11 + echo -e "\nReverse cooklist for: $pkg" 2.12 + separator && cd $wok 2.13 for rev in * 2.14 do 2.15 - if fgrep DEPENDS $rev/receipt | fgrep $pkg; then 2.16 - echo "TODO: $rev" 2.17 + unset DEPENDS BUILD_DEPENDS && . $wok/$rev/receipt 2.18 + if echo "$DEPENDS $BUILD_DEPENDS" | fgrep -q $pkg; then 2.19 + echo "$rev" | tee -a $cooklist 2.20 fi 2.21 - done ;; 2.22 + done && separator 2.23 + echo -e "Reverse dependencies found: $(cat $cooklist | wc -l)\n" 2.24 + strip_blocked 2.25 + cook_order | tee $LOGS/cookorder.log 2.26 + cook_list ;; 2.27 pkg|-p) 2.28 # Same as 'cook pkg' but with log for web interface. 2.29 pkg="$2" 2.30 echo "Cook started for: <a href='cooker.cgi?pkg=$pkg'>$pkg</a>" | log 2.31 - cook $pkg || broken ;; 2.32 + cook $pkg || broken 2.33 + empty_command ;; 2.34 cat|-c) 2.35 # Cook all packages of a category. 2.36 cat="$2" 2.37 @@ -284,8 +292,7 @@ 2.38 cp -a $list $cooklist 2.39 strip_blocked 2.40 cook_order | tee $LOGS/cookorder.log 2.41 - #cook_list 2.42 - ;; 2.43 + cook_list ;; 2.44 list|-l) 2.45 # Cook a list og package given in argument. 2.46 list="$2"