Author: glen                         Date: Wed May 10 19:14:35 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- allow comments and empty lines in mirrors file
- fix unbalanced mirror resolving left and right

---- Files affected:
SPECS:
   builder (1.428 -> 1.429) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.428 SPECS/builder:1.429
--- SPECS/builder:1.428 Thu Apr 27 18:43:58 2006
+++ SPECS/builder       Wed May 10 21:14:30 2006
@@ -602,18 +602,22 @@
 find_mirror()
 {
        cd "$SPECS_DIR"
-       url="$1"
+       local url="$1"
        if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
                cvs update mirrors >&2
        fi
 
        IFS="|"
-       while read origin mirror name rest
-       do
+       local origin mirror name rest ol prefix
+       while read origin mirror name rest; do
+               # skip comments and empty lines
+               if [ -z "$origin" ] || [[ $origin == \#* ]]; then
+                       continue
+               fi
                ol=`echo -n "$origin"|wc -c`
                prefix="`echo -n "$url" | head -c $ol`"
                if [ "$prefix" = "$origin" ] ; then
-                       suffix="`echo "$url"|cut -b $ol-`"
+                       suffix="`echo "$url"|cut -b $((ol+1))-`"
                        echo -n "$mirror$suffix"
                        return 0
                fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/builder?r1=1.428&r2=1.429&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to