[PC-BSD Commits] r15824 - pcbsd/current/system-overlay/var/db/pc-netupdate/meta-pcbsd

svn at pcbsd.org svn at pcbsd.org
Thu Mar 15 12:46:35 PDT 2012


Author: kris
Date: 2012-03-15 19:46:34 +0000 (Thu, 15 Mar 2012)
New Revision: 15824

Modified:
   pcbsd/current/system-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh
Log:

Improve the update script for the default meta-pkgset, now we save a 
copy of previous pkgs from master-pkg-index, which lets us determine
which pkgs are really newer than whats installed on disk.

This eliminates a problem where the user may manually update a port/pkg
before we "officially" issue it, and the update keeps prompting to revert
to the old pkg, thinking its newer



Modified: pcbsd/current/system-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh
===================================================================
--- pcbsd/current/system-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh	2012-03-15 18:57:43 UTC (rev 15823)
+++ pcbsd/current/system-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh	2012-03-15 19:46:34 UTC (rev 15824)
@@ -1,6 +1,22 @@
 #!/bin/sh
 
-rm -rf /var/db/pc-metapkgmanager/pkgsets/pcbsd 2>/dev/null
-mkdir -p /var/db/pc-metapkgmanager/pkgsets/pcbsd 2>/dev/null
-tar xvf ${1} -C /var/db/pc-metapkgmanager/pkgsets/pcbsd 2>/dev/null
-exit $?
+PKGSET="pcbsd"
+if [ -z "$PKGSET" ] ; then exit 1 ; fi
+PKDIR="/var/db/pc-metapkgmanager/pkgsets/${PKGSET}"
+
+# Save the old master index to search for updates
+if [ -e "${PKDIR}/master-pkg-index" ] ; then
+  cat ${PKDIR}/master-pkg-index | cut -d ':' -f 1-2 >> ${PKDIR}/master-pkg-index-old 
+  sort ${PKDIR}/master-pkg-index-old | uniq > /tmp/.prevpkgs.$$
+fi
+
+# Extract the new meta-pkg data
+rm -rf ${PKDIR} 2>/dev/null
+mkdir -p ${PKDIR} 2>/dev/null
+tar xvf ${1} -C ${PKDIR} 2>/dev/null
+err=$?
+
+if [ -e "/tmp/.prevpkgs.$$" ] ; then
+  mv /tmp/.prevpkgs.$$ ${PKDIR}/master-pkg-index-old
+fi
+exit $err



More information about the Commits mailing list