poldek: poldek/tests/sh/04-conf, poldek/conf.c - %include prependi...

mis mis at pld-linux.org
Wed Jun 27 23:47:48 CEST 2007


Author: mis                          Date: Wed Jun 27 21:47:48 2007 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- %include prependig fix

---- Files affected:
poldek/poldek/tests/sh:
   04-conf (1.1 -> 1.2) 
poldek/poldek:
   conf.c (1.83 -> 1.84) 

---- Diffs:

================================================================
Index: poldek/poldek/tests/sh/04-conf
diff -u poldek/poldek/tests/sh/04-conf:1.1 poldek/poldek/tests/sh/04-conf:1.2
--- poldek/poldek/tests/sh/04-conf:1.1	Mon Jun 25 17:43:41 2007
+++ poldek/poldek/tests/sh/04-conf	Wed Jun 27 23:47:42 2007
@@ -24,16 +24,57 @@
 {
     #cat $TMPDIR/poldek.conf
     create_local_conf
-    n=$($POLDEK --conf $TMPDIR/poldek.conf -q  -l | grep -vE '^dbg:' | wc -l)
+    poldek_l="$POLDEK --conf $TMPDIR/poldek.conf -q  -l"    
+
+    is_verbose_mode && $poldek_l
+
+    n=$($poldek_l | grep -vE '^dbg:' | wc -l)
     assertEquals "2 sources expected" "$n" "2"
 
-    #$POLDEK --conf $TMPDIR/poldek.conf -q  -l | grep -E '^test[12] '
-    n=$($POLDEK --conf $TMPDIR/poldek.conf -q  -l | grep -E '^test[12] ' | wc -l)
+    n=$($poldek_l | grep -E '^test[12] ' | wc -l)
     assertEquals "2 sources expected, but not those" "$n" "2"
-    #sources=$($POLDEK --conf $TMPDIR/poldek.conf -q  -l | grep -E ^test[12]
 }
 
-testRemoteConfAndMacros() {
+testConfInclude() 
+{
+    #cat $TMPDIR/poldek.conf
+    create_local_conf
+    conf="$TMPDIR/poldek.conf"
+    poldek_l="$POLDEK --conf $conf -q -l"    
+    cp $conf $conf.orig
+
+    msgn "%include foo.conf"
+
+    echo -e "[global]\n%include source.conf\n" > $conf
+    cat $conf.orig >> $conf
+    echo -e "[source]\nname=test3\ntype=pndir\npath=test:///foo/bar/z\n" > $TMPDIR/source.conf
+
+    is_verbose_mode && $poldek_l
+
+    n=$($poldek_l | grep 'test://' | wc -l)
+    assertEquals "3 sources expected, got $n" "$n" "3"
+
+    n=$($poldek_l | grep -E '^test[123] ' | wc -l)
+    assertEquals "3 sources expected, but not those" "$n" "3"
+
+
+    msgn "%include /bar/baz/foo.conf"
+
+    echo -e "[global]\n%include $REPO/source-abs.conf\n" > $conf
+    cat $conf.orig >> $conf
+    echo -e "[source]\nname=test4\ntype=pndir\npath=test:///foo/bar/z\n" > $REPO/source-abs.conf
+    is_verbose_mode && $poldek_l
+
+    n=$($poldek_l | grep 'test://' | wc -l)
+    assertEquals "3 sources expected, got $n" "$n" "3"
+
+    n=$($poldek_l | grep -E '^test[124] ' | wc -l)
+    [ "$n" == "3" ] && assertEquals "3 sources expected, but not those" "$n" "3"
+}
+
+
+testRemoteConfAndMacros() 
+{
 
     create_local_conf
 
@@ -72,7 +113,7 @@
     poldek_l="$POLDEK --conf $TMPDIR/poldek.conf -q -l"
     poldek_l_cdir="$poldek_l --cachedir $CACHEDIR"
 
-    n=$($poldek_l --noconf | grep -vE '^dbg:' | wc -l)
+    n=$($poldek_l --noconf | grep 'test://' | wc -l)
     assertEquals "--noconf failed" "$n" "0"
 
     #$POLDEK --conf $TMPDIR/poldek.conf  -l --cachedir $CACHEDIR
@@ -83,10 +124,10 @@
     is_verbose_mode && $poldek_l_cdir
 
     n=$($poldek_l_cdir | grep -E '^test[1234] ' | wc -l)
-    assertEquals "4 sources expected, but not those" "$n" "4"
+    [ "$n" == "4" ] && assertEquals "4 sources expected, but not those" "$n" "4"
 
     n=$($poldek_l_cdir  -l | grep -E '^xtest[1234] ' | wc -l)
-    assertEquals "2 xtest* sources expected, but not those $n" "$n" "2"
+    [ "$n" == "2" ] && assertEquals "2 xtest* sources expected, but not those $n" "$n" "2"
 
     msgn "upconf"
 
@@ -106,12 +147,12 @@
     #cat $TMPDIR/poldek.conf
     is_verbose_mode && $poldek_l_cdir
 
-    n=$($poldek_l_cdir | grep -vE '^dbg:' | wc -l)
+    n=$($poldek_l_cdir | grep 'test://' | wc -l)
     assertEquals "6 sources expected" "$n" "6"
 
     #$POLDEK --conf $TMPDIR/poldek.conf -q  -l | grep -E '^test[12] '
     n=$($poldek_l_cdir | grep -E '^test[1234] ' | wc -l)
-    assertEquals "4 sources expected, but not those" "$n" "4"
+    [ "$n" == "4" ] && assertEquals "4 sources expected, but not those" "$n" "4"
 
     POLDEK_TESTING_DENIED_FILES=""
     $POLDEK --conf $TMPDIR/poldek.conf --upconf --cachedir $CACHEDIR
@@ -121,10 +162,10 @@
     assertEquals "8 sources exepected, got $n" "$n" "8"
 
     n=$($poldek_l_cdir | grep -E '^test[1234] ' | wc -l)
-    assertEquals "4 sources expected, but not those" "$n" "4"
+    [ "$n" == "4" ] && assertEquals "4 sources expected, but not those" "$n" "4"
 
     n=$($poldek_l_cdir | grep -E '^xtest[1234] ' | wc -l)
-    assertEquals "4 sources expected, but not those" "$n" "4"
+    [ "$n" == "4" ] && assertEquals "4 sources expected, but not those" "$n" "4"
 
     n=$(find $CACHEDIR -name \*.conf | wc -l)
     assertEquals "Expected cachedir/remote.conf only" "$n" "1"
@@ -140,10 +181,10 @@
     assertEquals "8 sources exepected, got $n" "$n" "8"
 
     n=$($poldek_l_cdir | grep -E '^test[1234] ' | wc -l)
-    assertEquals "4 sources expected, but not those" "$n" "4"
+    [ "$n" == "4" ] && assertEquals "4 sources expected, but not those" "$n" "4"
 
     n=$($poldek_l_cdir | grep -E '^xtest[1234] ' | wc -l)
-    assertEquals "4 sources expected, but not those" "$n" "4"
+    [ "$n" == "4" ] && assertEquals "4 sources expected, but not those" "$n" "4"
 
     n=$(find $CACHEDIR -name remote.conf | wc -l)
     assertEquals "Where is remote.conf cached copy??" "$n" "1"

================================================================
Index: poldek/poldek/conf.c
diff -u poldek/poldek/conf.c:1.83 poldek/poldek/conf.c:1.84
--- poldek/poldek/conf.c:1.83	Wed Jun 27 02:44:47 2007
+++ poldek/poldek/conf.c	Wed Jun 27 23:47:43 2007
@@ -670,7 +670,7 @@
     
     is_local = (vf_url_type(path) == VFURL_PATH);
     if (ppath)
-        is_parent_remote = (vf_url_type(ppath) == VFURL_PATH);
+        is_parent_remote = (vf_url_type(ppath) != VFURL_PATH);
 
     if (ppath) {
         int prepend = 0;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/poldek/tests/sh/04-conf?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/poldek/poldek/conf.c?r1=1.83&r2=1.84&f=u



More information about the pld-cvs-commit mailing list