# HG changeset patch # User Christophe Lincoln # Date 1304696195 -7200 # Node ID 5782ad5be7118bbf93ff0629c033cc644583bc9d # Parent 62fa13d0214215fe8882e850916801a9800dca82 cooker: finalize reverse command diff -r 62fa13d02142 -r 5782ad5be711 cook --- a/cook Fri May 06 17:05:53 2011 +0200 +++ b/cook Fri May 06 17:36:35 2011 +0200 @@ -396,6 +396,7 @@ # ERROR can be echoed any time in cookit() if grep -q ^ERROR $LOGS/$pkg.log; then debug_info | tee -a $LOGS/$pkg.log + rm -f $command exit 1 fi } @@ -481,10 +482,11 @@ # Verify package quality and consitensy. packit_quality() { if grep -q ^ERROR $LOGS/$pkg.log; then - exit 1 + rm -f $command && exit 1 fi if ! grep -q ^/ $WOK/$pkg/taz/$pkg-*/files.list; then - echo -e "ERROR: empty package\n" | tee -a $LOGS/$pkg.log && exit 1 + echo -e "ERROR: empty package\n" | tee -a $LOGS/$pkg.log + rm -f $command && exit 1 else mv -f $WOK/$pkg/taz/$pkg-*.tazpkg $PKGS sed -i /^${pkg}$/d $broken @@ -496,7 +498,7 @@ # case "$1" in - usage|help) + usage|help|-u|-h) usage ;; list-wok) gettext "List of packages in:"; echo " $WOK" diff -r 62fa13d02142 -r 5782ad5be711 cooker --- a/cooker Fri May 06 17:05:53 2011 +0200 +++ b/cooker Fri May 06 17:36:35 2011 +0200 @@ -250,19 +250,27 @@ # Use hg commit ? Ex: hg commit -m "Message bla bla | cooker:reverse" # pkg="$2" - [ ! -d "$wok/$pkg" ] && echo "No package $2 found." && exit 0 - cd $wok + [ ! -d "$wok/$pkg" ] && echo -e "\nNo package $2 found.\n" && exit 0 + rm -f $cooklist && touch $cooklist && cd $wok + echo -e "\nReverse cooklist for: $pkg" + separator && cd $wok for rev in * do - if fgrep DEPENDS $rev/receipt | fgrep $pkg; then - echo "TODO: $rev" + unset DEPENDS BUILD_DEPENDS && . $wok/$rev/receipt + if echo "$DEPENDS $BUILD_DEPENDS" | fgrep -q $pkg; then + echo "$rev" | tee -a $cooklist fi - done ;; + done && separator + echo -e "Reverse dependencies found: $(cat $cooklist | wc -l)\n" + strip_blocked + cook_order | tee $LOGS/cookorder.log + cook_list ;; pkg|-p) # Same as 'cook pkg' but with log for web interface. pkg="$2" echo "Cook started for: $pkg" | log - cook $pkg || broken ;; + cook $pkg || broken + empty_command ;; cat|-c) # Cook all packages of a category. cat="$2" @@ -284,8 +292,7 @@ cp -a $list $cooklist strip_blocked cook_order | tee $LOGS/cookorder.log - #cook_list - ;; + cook_list ;; list|-l) # Cook a list og package given in argument. list="$2"