Author: adsb
Date: 2008-10-25 17:12:11 +0000 (Sat, 25 Oct 2008)
New Revision: 1674

Modified:
   trunk/debian/changelog
   trunk/scripts/getbuildlog.sh
Log:
Simplify a couple of variable assignments and use shell string
operations to extract the version and architecture from the logs.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-10-25 16:57:26 UTC (rev 1673)
+++ trunk/debian/changelog      2008-10-25 17:12:11 UTC (rev 1674)
@@ -7,6 +7,8 @@
   * getbuildlogs:
     + Unescape %7Es in log URLs to allow explicitly searching for 
       package versions containing tildes.
+    + Simplify a couple of variable assignments and use shell string
+      operations to extract the version and architecture from the logs.
   * uscan: Document the USCAN_TIMEOUT configuration file variable.
     (Closes: #502517)
 

Modified: trunk/scripts/getbuildlog.sh
===================================================================
--- trunk/scripts/getbuildlog.sh        2008-10-25 16:57:26 UTC (rev 1673)
+++ trunk/scripts/getbuildlog.sh        2008-10-25 17:12:11 UTC (rev 1674)
@@ -65,8 +65,8 @@
 fi
 
 PACKAGE=$1
-VERSION=`(test -z "$2" && echo "[:~+.[:alnum:]-]+") || echo "$2"`
-ARCH=`(test -z "$3" && echo "[[:alnum:]-]+") || echo "$3"`
+VERSION=${2:-[:~+.[:alnum:]-]+}
+ARCH=${3:-[[:alnum:]-]+}
 ESCAPED_PACKAGE=`echo "$PACKAGE" | sed -e 's/\+/\\\+/g'`
 
 PATTERN="fetch\.(cgi|php)\?&pkg=$ESCAPED_PACKAGE&ver=$VERSION&arch=$ARCH&\
@@ -85,8 +85,10 @@
     sed -i -e "s/%2B/\+/g" -e "s/%3A/:/g" -e "s/%7E/~/g" $ALL_LOGS
 
     for match in `grep -E -o "$PATTERN" $ALL_LOGS`; do
-        ver=`echo $match | cut -d'&' -f3 | cut -d'=' -f2`
-        arch=`echo $match | cut -d'&' -f4 | cut -d'=' -f2`
+       ver=${match##*ver=}
+       ver=${ver%%&*}
+       arch=${match##*arch=}
+       arch=${arch%%&*}
        match=`echo $match | sed -e 's/\+/%2B/g'`
         wget -O "${PACKAGE}_${ver}_${arch}.log" "$BASE/$match&file=log"
     done



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to