]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
jail-upgrade: fixed bugs and made it recursive
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 6 Nov 2006 21:07:01 +0000 (21:07 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 6 Nov 2006 21:07:01 +0000 (21:07 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@24 04377dda-e619-0410-9926-eae83683ac58

doc/CHANGELOG
src/jail-upgrade
src/simplaret

index 5a795cc1e3ab23735130ff77a5c44929ce3d8566..d473559619c077026f62e73421e0d1d8e220ba46 100644 (file)
@@ -1,6 +1,10 @@
 simplepkg changelog
 -------------------
 
+0.4.9pre7: jail-upgrade:
+             - fix in swaret upgrade method
+             - act recursively on patches' folder
+
 0.4.9pre6: createpkg:
              - fixes
              - now with slackbuild error handling
index b9567fdc85771d528ac2edf55a5d68454b78d4dd..c33180c5497406631609785d47a102f85c4190be 100755 (executable)
@@ -20,14 +20,20 @@ COMMON="/usr/libexec/simplepkg/common.sh"
 
 function swaret_jail_upgrade {
 
+  echo upgrading jail $1...
+
   if [ ! -d "$PATCHES_DIR" ]; then
-    cd $PATCHES_DIR
-    for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do
-      if [[ $pack == `package_name $installed.tgz` ]]; then
-        if [[ "`basename $installed`" != "`basename $file .tgz`" ]]; then
-          ROOT=$1 upgradepkg $file
+    # cd $PATCHES_DIR
+    # for file in `ls *tgz`; do
+    for file in `find $PATCHES_DIR -name *tgz`; do
+      pack=`package_name $file`
+      for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do
+        if [[ $pack == `package_name $installed.tgz` ]]; then
+          if [[ "`basename $installed`" != "`basename $file .tgz`" ]]; then
+            ROOT=$1 upgradepkg $file
+          fi
         fi
-      fi
+      done
     done
   fi
 }
@@ -44,8 +50,9 @@ function simplaret_jail_upgrade {
   fi
 
   if [ -d "$PATCHES_DIR/$ARCH/$VERSION" ]; then
-    cd $PATCHES_DIR/$ARCH/$VERSION
-    for file in `ls *tgz`; do
+    # cd $PATCHES_DIR/$ARCH/$VERSION
+    # for file in `ls *tgz`; do
+    for file in `find $PATCHES_DIR/$ARCH/$VERSION -name *tgz`; do
       pack=`package_name $file`
       for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do
         if [[ "$pack" == "`package_name $installed.tgz`" ]]; then
@@ -101,7 +108,16 @@ elif [ -d "$JAIL_ROOT/$1" ]; then
   else
     echo error: jail $JAIL_ROOT/$1 dont looks like a slackware system
   fi
+# elif [ -f "$1" ]; then
+#  basename="`basename $1 tgz`"
+#  if [ "`basename $1 | sed -e "s/^$basename//"`" == "tgz" ]; then
+#    # TODO:
+#    # - descobrir a arquitetura do pacote
+#    # - atualizar nas jaulas de mesma arquitetura
+#    true
+#  fi
 else
   echo "error: jail $0 does not exist"
   exit 1
 fi
+
index b2b7d2bba2937518333fb5fbc0c425f53f0fab6d..cdcf430b84e524bf95c76f693b80efd69cb8e919 100755 (executable)
@@ -371,7 +371,7 @@ function simplaret_get_patches {
 
   echo fetching patches for arch $ARCH and version $VERSION...
 
-  # check for the downloaded patches
+  # check for downloaded patches
   for patch in `ls $PATCHES_DIR/$ARCH/$VERSION/*tgz 2> /dev/null`; do
     file="`find $STORAGE/$ARCH/$VERSION/ -name $patch 2> /dev/null`"
     if [ ! -f "$file" ]; then