]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
common.sh: install_packages fix
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 10 Dec 2006 23:06:01 +0000 (23:06 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 10 Dec 2006 23:06:01 +0000 (23:06 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@70 04377dda-e619-0410-9926-eae83683ac58

lib/common.sh
src/simplaret

index ed00779dff632348712d3594d2bbc12312d306a1..5da1ed7e0cfb11fc7982ff6bba1fc9a5fd917ee9 100644 (file)
@@ -132,12 +132,25 @@ function install_packages {
     # if the package wasnt found, try to donwload it
     if [[ "$package_downloaded" != "1" ]]; then
       ARCH=$ARCH VERSION=$VERSION $SIMPLARET --get $pack -a
-      for file in `find $STORAGE/$extrafolder -name $pack*tgz`; do
+
+      # it can be stored at the patches folder
+      for file in `find $PATCHES_DIR/$extrafolder -name $pack*tgz`; do
         if [[ "`package_name $file`" == "$pack" ]]; then
           package_file="$file"
           break
         fi
       done
+
+      # or it can be stored at the standard packages folder
+      if [ -z "$package_file" ]; then
+        for file in `find $STORAGE/$extrafolder -name $pack*tgz`; do
+          if [[ "`package_name $file`" == "$pack" ]]; then
+            package_file="$file"
+            break
+          fi
+        done
+      fi
+
     fi
 
     # now tries to install the package, if available
index ae738f2d2d0f708bdeaf818b77f348e5b7812ac6..4ab577274492e98327d70f61380c5e90e945db8e 100755 (executable)
@@ -464,7 +464,7 @@ 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?
+      # 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
@@ -482,7 +482,12 @@ function simplaret_get_jail_patches {
   # usage: simplaret_get_jail_patches <jail-folder>
 
   local oldarch oldversion
-  root="$1"
+
+  if [ ! -z "$1" ]; then
+    root="$1"
+  else
+    root="/"
+  fi
 
   # save current arch and version
   oldarch="$ARCH"
@@ -529,7 +534,7 @@ function simplaret_get_patches {
   local jailpath
 
   # first get patches from the root system
-  simplaret_get_jail_patches /
+  simplaret_get_jail_patches
 
   # then get the needed patches for each installed jail
   if [ -s "$JAIL_LIST" ]; then