Check-in [82b60b8633]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:82b60b8633d06328b28c9ead9d444fba8c3863a6
Date: 2012-08-31 07:23:20
User: BarryK
Comment:npierce: ppm: deps versioning was not working in dependencies.sh

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/local/petget/dependencies.sh

@@ -23,10 +23,12 @@
 #110723 remove hardcoded path /root/.packages, so can run script in Woof.
 #110822 versioning operators can be chained, ex: +linux_kernel&ge2.6.32&lt2.6.33
 #111107 01micko: fix for '||' messing things up.
 #120203 BK: internationalized.
 #120221 jemimah: grep '[a-zA-Z]' so as to find deps with all capitals (ex: SDL).
+#120831 npierce, jemimah: findmissingpkgs.sh creates /tmp/petget_missingpkgs_patterns and /tmp/petget_missingpkgs_patterns_with_versioning, need to use latter here.
+#       refer: http://www.murga-linux.com/puppy/viewtopic.php?p=648934#648934
 
 export TEXTDOMAIN=petget___dependencies.sh
 export OUTPUT_CHARSET=UTF-8
 
 if [ -f ./PKGS_MANAGEMENT ];then #110723
@@ -127,13 +129,17 @@
 
 #now find the entries in the databases...
 rm -f /tmp/petget_missing_dbentries* 2>/dev/null
 #for depPATTERN in `cat /tmp/petget_missingpkgs_patterns` #ex depPATTERN=|kdelibs| ex2: |kdelibs&gt2.3.6|
 #111107 01micko: fix for '||' messing things up...
-for depPATTERN in `grep '[a-zA-Z]' /tmp/petget_missingpkgs_patterns` #ex depPATTERN=|kdelibs| ex2: |kdelibs&gt2.3.6|. 120221 jemimah
+#for depPATTERN in `grep '[a-zA-Z]' /tmp/petget_missingpkgs_patterns` #ex depPATTERN=|kdelibs| ex2: |kdelibs&gt2.3.6|. 120221 jemimah
+#120831 actually, there is no version info in /tmp/petget_missingpkgs_patterns, findmissingpkgs.sh filtered it out,
+# need to use /tmp/petget_missingpkgs_patterns_with_versioning, which has lines like this: |kdebase|ge2.3.6|lt2.4.5|
+for depPATTERN in `grep '[a-zA-Z]' /tmp/petget_missingpkgs_patterns_with_versioning` #120831
 do
 
+ depPATTERN="`echo -n "$depPATTERN" | sed -e 's%|%\&%g' -e 's%^\&%|%' -e 's%\&$%|%'`" #120831 this restores dep field, ex |kdebase|ge2.3.6|lt2.4.5| to |kdebase&ge2.3.6&lt2.4.5|
  #110722 separate out any versioning... (see also findmissingpkgs.sh)
  xdepPATTERN="`echo -n "$depPATTERN" | sed -e 's%&.*%|%'`" #ex: changes |kdelibs&gt2.3.6| to |kdelibs|
  depVERSIONING="`echo -n "$depPATTERN" | grep -o '&.*' | tr -d '|'`" #ex: &gt2.3.6
  if [ "$depVERSIONING" ];then
   #VERTEST_OP="`echo -n "$depVERSIONING" | cut -c 2,3`" #ex: gt
@@ -146,12 +152,19 @@
 
  for ONEREPODB in $DB_MAIN $DB_OTHERS
  do
   DBFILE="`basename $ONEREPODB`" #ex: Packages-slackware-12.2-official
   #find database entry(s) for this package...
-  DB_ENTRY="`cat $ONEREPODB | grep "$depPATTERN"`"
-  if [ "$DB_ENTRY" != "" ];then
+  #DB_ENTRY="`cat $ONEREPODB | grep "$depPATTERN"`"
+  #if [ "$DB_ENTRY" != "" ];then
+  #120831 there could be multiple entries found, create DB_ENTRIES instead of just one DB_ENTRY, now DB_ENTRY and DB_VERSION in a loop...
+  FOUND_IN_DB=""
+  DB_ENTRIES="`cat $ONEREPODB | grep "$xdepPATTERN"`"
+  while [ -n "$DB_ENTRIES" ] ;
+  do
+   DB_ENTRY="`echo -n "$DB_ENTRIES" | head -n 1`"
+   DB_ENTRIES="`echo -n "$DB_ENTRIES" | tail -n +2`"
    DB_version="`echo -n "$DB_ENTRY" | cut -f 3 -d '|'`"
    if [ "$depVERSIONING" ];then #110722
     #110822 support chained operators...
     condFLG='good'
     for ACOND in $DEPCONDS #ex: gt5.6.7 lt6.7.8
@@ -162,20 +175,25 @@
       condFLG='bad'
      fi
     done
     if [ "$condFLG" = "good" ];then
      echo "$DB_ENTRY" >> /tmp/petget_missing_dbentries-${DBFILE}-2
-     break
+     #break
+     FOUND_IN_DB="good" #120831
     fi
     #if vercmp ${DB_version} ${VERTEST_OP} ${VERTEST_VAL};then
     # echo "$DB_ENTRY" >> /tmp/petget_missing_dbentries-${DBFILE}-2
     # break
     #fi
    else
     echo "$DB_ENTRY" >> /tmp/petget_missing_dbentries-${DBFILE}-2
-    break
+    #break
+    FOUND_IN_DB="good" #120831
    fi
+  done #120831 DB_ENTRIES loop
+  if [ "$FOUND_IN_DB" = "good" ];then #120831
+   break
   fi
  done
 done
 #clean them up...
 for ONEREPODB in $DB_MAIN $DB_OTHERS

Changes to woof-code/rootfs-skeleton/usr/local/petget/findmissingpkgs.sh

@@ -19,13 +19,13 @@
 . /root/.packages/PKGS_MANAGEMENT #has DISTRO_PPM_DEVX_EXCEPTIONS, PKG_ALIASES_INSTALLED
 
 #110722 versioning info added to dependencies...
 #the dependencies field can now have &ge, &gt, &eq, &le, &lt
 #ex1: |+ncurses,+readline&ge2.3.5,+glibc|
-#chained operators allowed: ex2: |+ncurses,+readline&ge2.3.5&&lt2.3.6,+glibc|
+#chained operators allowed: ex2: |+ncurses,+readline&ge2.3.5&lt2.3.6,+glibc|
 #if you want a package to be kernel version sensitive:
-#ex3: |+ncurses,+readline+glibc,+linux_kernel&ge2.6.39|
+#ex3: |+ncurses,+readline,+glibc,+linux_kernel&ge2.6.39|
 
 xDB_dependencies="`echo -n "$DB_dependencies" | tr ',' '\n' | cut -f 1 -d '&' | tr '\n' ','`" #110722 chop off any versioning info.
 
 #make pkg deps into patterns... 110722 change DB_dependencies to xDB_dependencies...
 PKGDEPS_PATTERNS="`echo -n "$xDB_dependencies" | tr ',' '\n' | grep '^+' | sed -e 's%^+%%' -e 's%^%|%' -e 's%$%|%'`"
@@ -125,7 +125,8 @@
 MISSINGDEPS_PATTERNS_WITHVER="`grep --file=/tmp/petget_missingpkgs_patterns /tmp/petget_pkg_deps_patterns_with_versioning | grep -v '^$'`"
 echo "$MISSINGDEPS_PATTERNS_WITHVER" > /tmp/petget_missingpkgs_patterns_with_versioning #can be read by dependencies.sh, find_deps.sh.
 #...ex each line: |kdebase|ge2.3.6|
 # ex with chained operators: |kdebase|ge2.3.6|lt2.4.5|
 #note, dependencies.sh currently not using this file.
+#120831 npierce, jemimah: dependencies.sh now using /tmp/petget_missingpkgs_patterns_with_versioning.
 
 ###END###