[PC-BSD Commits] r17705 - in pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate: meta-pcbsd meta-warden

svn at pcbsd.org svn at pcbsd.org
Tue Jul 10 12:55:34 PDT 2012


Author: kris
Date: 2012-07-10 19:55:34 +0000 (Tue, 10 Jul 2012)
New Revision: 17705

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

Add checking of system version to meta-pkg updater. Now we wont get updates
for different versions of a snapshot



Modified: pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh
===================================================================
--- pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh	2012-07-10 16:21:10 UTC (rev 17704)
+++ pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate/meta-pcbsd/update.sh	2012-07-10 19:55:34 UTC (rev 17705)
@@ -4,6 +4,19 @@
 if [ -z "$PKGSET" ] ; then exit 1 ; fi
 PKDIR="/var/db/pc-metapkgmanager/pkgsets/${PKGSET}"
 
+# Make sure this tag matches the system version
+mkdir /tmp/metaup.$$
+tar xvf ${1} -C /tmp/metaup.$$ ./pcbsd-tag 2>/dev/null
+tag=`cat /tmp/metaup.$$/pcbsd-tag`
+rm /tmp/metaup.$$/pcbsd-tag
+rmdir /tmp/metaup.$$
+
+# Is this the correct version?
+if [ `cat /tmp/metaup.$$/pcbsd-tag` != `pbreg get /PC-BSD/Version` ] ; then
+  echo "Meta-Update mismatch!"
+  exit 0
+fi 
+
 # 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 

Modified: pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate/meta-warden/update.sh
===================================================================
--- pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate/meta-warden/update.sh	2012-07-10 16:21:10 UTC (rev 17704)
+++ pcbsd/current/overlays/desktop-overlay/var/db/pc-netupdate/meta-warden/update.sh	2012-07-10 19:55:34 UTC (rev 17705)
@@ -4,6 +4,19 @@
 if [ -z "$PKGSET" ] ; then exit 1 ; fi
 PKDIR="/var/db/pc-metapkgmanager/pkgsets/${PKGSET}"
 
+# Make sure this tag matches the system version
+mkdir /tmp/metaup.$$
+tar xvf ${1} -C /tmp/metaup.$$ ./pcbsd-tag 2>/dev/null
+tag=`cat /tmp/metaup.$$/pcbsd-tag`
+rm /tmp/metaup.$$/pcbsd-tag
+rmdir /tmp/metaup.$$
+
+# Is this the correct version?
+if [ `cat /tmp/metaup.$$/pcbsd-tag` != `pbreg get /PC-BSD/Version` ] ; then
+  echo "Meta-Update mismatch!"
+  exit 0
+fi
+
 # 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 



More information about the Commits mailing list