]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplaret: simplaret_search_and_download_patch fix
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 10 Dec 2006 23:32:42 +0000 (23:32 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 10 Dec 2006 23:32:42 +0000 (23:32 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@72 04377dda-e619-0410-9926-eae83683ac58

src/simplaret

index 2d39dbe4d31f1033e52bbe0b4c2de1e571bc84b3..581660ffb412463a32229582a9c057ea8645626c 100755 (executable)
@@ -439,24 +439,24 @@ function simplaret_search_and_download_patch {
   local package_version package_build
 
   # get just the file name
-  candidate="`echo $candidate | cut -d , -f 1`"
+  sugested="`echo $sugested | cut -d , -f 1`"
 
   # now split the file name into pieces
-  package_version="`package_version $candidate`"
-  package_build="`package_build $candidate`"
-  candidate="`package_name $candidate`"
+  package_version="`package_version $sugested`"
+  package_build="`package_build $sugested`"
+  sugested="`package_name $sugested`"
 
   # check if the patch was already downloaded
-  if echo $DOWNLOADED_PATCHES | grep -q " $candidate "; then
+  if echo $DOWNLOADED_PATCHES | grep -q " $sugested "; then
     return
   fi
 
   # search if its installed in the jail
-  installed_packs="`ls /$root/var/log/packages/$candidate* 2> /dev/null`"
+  installed_packs="`ls /$root/var/log/packages/$sugested* 2> /dev/null`"
   if [ ! -z "$installed_packs" ]; then
 
     for installed in $installed_packs; do
-      if [[ "$candidate" == "`package_name $installed.tgz`" ]]; then
+      if [[ "$sugested" == "`package_name $installed.tgz`" ]]; then
         package_installed="1"
         break
       fi
@@ -464,10 +464,10 @@ function simplaret_search_and_download_patch {
 
     # if the package is installed, download the patch
     if [[ "$package_installed" == "1" ]]; then
-      # TODO: verificar se eh a mesma versao e build number que esta instalada?
-      # DOWNLOAD_EVEN_IF_APPLIED?
-      simplaret_get $candidate
-      DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $candidate " # the ending space is important
+      simplaret_get $sugested
+      if [ "$?" == "0" ]; then
+        DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $sugested " # the ending space is important
+      fi
     fi
 
   fi
@@ -507,18 +507,18 @@ function simplaret_get_jail_patches {
   echo fetching patches for arch $ARCH and version $VERSION for jail $root
 
   # list all available patches in PATCHES repositories
-  for candidate in `simplaret_search -formatted | grep patches`; do
+  for sugested in `simplaret_search -formatted | grep patches`; do
     simplaret_search_and_download_patch
   done
 
   # list all available patches in ROOT repositories
-  for candidate in `simplaret_search patches -formatted | grep root`; do
+  for sugested in `simplaret_search patches -formatted | grep root`; do
     simplaret_search_and_download_patch
   done
 
   # grab patches from every other places
   if [ "$CONSIDER_ALL_PACKAGES_AS_PATCHES" == "1" ]; then
-    for candidate in `simplaret_search patches -formatted | grep -v patches | grep -v root`; do
+    for sugested in `simplaret_search patches -formatted | grep -v patches | grep -v root`; do
       simplaret_search_and_download_patch
     done
   fi