tazwok rev 280

Speed-up scan() by using -m1 in some grep commands (catch only one occurence).
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Feb 14 17:46:23 2011 +0100 (2011-02-14)
parents e01867d7ec3c
children 36d4194ff2a2
files tazwok
line diff
     1.1 --- a/tazwok	Mon Feb 14 17:42:45 2011 +0100
     1.2 +++ b/tazwok	Mon Feb 14 17:46:23 2011 +0100
     1.3 @@ -1444,10 +1444,10 @@
     1.4  look_for_dep()
     1.5  {
     1.6  	if [ "$undigest" ] && [ ! -f "$WOK/$PACKAGE/receipt" ]; then
     1.7 -		grep ^$PACKAGE$'\t' $SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming/wok-depends.txt \
     1.8 +		grep -m1 ^$PACKAGE$'\t' $SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming/wok-depends.txt \
     1.9  			| cut -f 2
    1.10  	else
    1.11 -		grep ^$PACKAGE$'\t' $INCOMING_REPOSITORY/wok-depends.txt | \
    1.12 +		grep -m1 ^$PACKAGE$'\t' $INCOMING_REPOSITORY/wok-depends.txt | \
    1.13  			cut -f 2
    1.14  	fi
    1.15  }
    1.16 @@ -1460,10 +1460,10 @@
    1.17  look_for_all()
    1.18  {
    1.19  	if [ "$undigest" ] && [ ! -f "$WOK/$PACKAGE/receipt" ]; then
    1.20 -		grep ^$PACKAGE$'\t' $SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming/wok-depends.txt \
    1.21 +		grep -m1 ^$PACKAGE$'\t' $SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming/wok-depends.txt \
    1.22  			| cut -f 2,3 | sed 's/ 	 / /'
    1.23  	else
    1.24 -		grep ^$PACKAGE$'\t' $INCOMING_REPOSITORY/wok-depends.txt | \
    1.25 +		grep -m1 ^$PACKAGE$'\t' $INCOMING_REPOSITORY/wok-depends.txt | \
    1.26  			cut -f 2,3 | sed 's/ 	 / /'
    1.27  	fi
    1.28  }
    1.29 @@ -1498,9 +1498,9 @@
    1.30  look_for_wanted()
    1.31  {
    1.32  	if [ "$undigest" ] && [ ! -f "$WOK/$PACKAGE/receipt" ]; then
    1.33 -		grep ^$PACKAGE$'\t' $SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming/wok-wanted.txt | cut -f 2
    1.34 +		grep -m1 ^$PACKAGE$'\t' $SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming/wok-wanted.txt | cut -f 2
    1.35  	else
    1.36 -		grep ^$PACKAGE$'\t' $INCOMING_REPOSITORY/wok-wanted.txt | cut -f 2
    1.37 +		grep -m1 ^$PACKAGE$'\t' $INCOMING_REPOSITORY/wok-wanted.txt | cut -f 2
    1.38  	fi
    1.39  }
    1.40