[PC-BSD Commits] r21983 - in pcbsd/current/src-sh: libsh pc-metapkgmanager

svn at pcbsd.org svn at pcbsd.org
Wed Mar 27 14:22:41 PDT 2013


Author: kris
Date: 2013-03-27 21:22:41 +0000 (Wed, 27 Mar 2013)
New Revision: 21983

Modified:
   pcbsd/current/src-sh/libsh/functions.sh
   pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
Log:

Cache downgrade files, and also don't clean cache after a failure



Modified: pcbsd/current/src-sh/libsh/functions.sh
===================================================================
--- pcbsd/current/src-sh/libsh/functions.sh	2013-03-27 10:57:56 UTC (rev 21982)
+++ pcbsd/current/src-sh/libsh/functions.sh	2013-03-27 21:22:41 UTC (rev 21983)
@@ -23,7 +23,7 @@
   do
      lTag=`echo $line | awk '{print $1}'` 
      case $lTag in
-    Upgrading) pkgList="`echo $line | awk '{print $2}' | sed 's|:||g'`-`echo $line | awk '{print $5}'`.txz $pkgList" ;;
+    Upgrading|Downgrading) pkgList="`echo $line | awk '{print $2}' | sed 's|:||g'`-`echo $line | awk '{print $5}'`.txz $pkgList" ;;
  Reinstalling) pkgList="`echo $line | awk '{print $2}'`.txz $pkgList" ;;
    Installing) pkgList="`echo $line | awk '{print $2}' | sed 's|:||g'`-`echo $line | awk '{print $3}'`.txz $pkgList" ;;
                     *) continue ;;

Modified: pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2013-03-27 10:57:56 UTC (rev 21982)
+++ pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2013-03-27 21:22:41 UTC (rev 21983)
@@ -88,7 +88,7 @@
   	fi
 
         # Lets pre-download all packages
-        download_cache_packages "pkg-static install -L -n $pkgName"
+        download_cache_packages "pkg-static install -U -n $pkgName"
 
         # Time to run pkgng and let it install packages!
 	pkg install -yLf "$pkgName"
@@ -309,7 +309,7 @@
 	fi
         flags="$flags $1"
      else
-        flags="-L -n"
+        flags="-U -n"
      fi
      count=`expr $count + 1`
      shift
@@ -323,7 +323,7 @@
    result=$?
 
    # Nobody likes a litter bug
-   if [ -d "${PKG_CACHEDIR}/All" ] ; then
+   if [ $result -eq 0 -a -d "${PKG_CACHEDIR}/All" ] ; then
       echo -e "Cleaning up cache files..\c"
       rm -rf "${PKG_CACHEDIR}/All"
       echo -e "Done"
@@ -332,6 +332,19 @@
    exit $result
 }
 
+get_file_dl()
+{
+   if [ "$2" = "-o" ] ; then
+      dlOut="$3"
+      dlPath="$4"
+   else
+      dlOut="`basename $2`"
+      dlPath="$2"
+   fi
+   get_file_from_mirrors "$dlPath" "$dlOut"
+   exit $?
+}
+
 # Parse the flags we are sending over to pkg
 # will intercept the install / upgrade flags
 # and use our internal function to download
@@ -340,6 +353,7 @@
 {
    case $1 in
  install|upgrade) intercept_pkg_dl ${@} ;;
+         getfile) get_file_dl ${@} ;;
                *) pkg ${@} 
                   exit $?
                   ;;



More information about the Commits mailing list