[PC-BSD Commits] r19041 - pcbsd/current/src-sh/pc-updatemanager

svn at pcbsd.org svn at pcbsd.org
Tue Sep 11 08:15:53 PDT 2012


Author: kris
Date: 2012-09-11 15:15:53 +0000 (Tue, 11 Sep 2012)
New Revision: 19041

Modified:
   pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
Log:

Update pc-updatemanager, add some error checking to downloads, and remove
exit_err



Modified: pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2012-09-11 15:15:10 UTC (rev 19040)
+++ pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2012-09-11 15:15:53 UTC (rev 19041)
@@ -129,7 +129,7 @@
 do_check() {
 
 	# Now fetch the update file
-	fetch -o "${PATCHTMPFILE}" "${PATCHURL}" >/dev/null 2>/dev/null 
+    	get_file "${PATCHURL}" "${PATCHTMPFILE}" 3
 	if [ "$?" = "0" ] ; then
 	  # If we have new update-data file, extract it
  	  cd ${AVAILDIR}/${SYSVER}
@@ -240,11 +240,6 @@
 	exit 0
 }
 
-exit_err() {
-	echo "ERROR: ${1}"
-	exit 1
-}
-
 # Make sure we aren't doing stand-alone apps at same time
 sanity_check_updates() {
 	hRelease=no
@@ -311,6 +306,10 @@
 
 	# Get the file
     	get_file "${FILEURL}" "${DOWNLOADDIR}/${FILENAME}" 3
+	if [ $? -ne 0 ] ; then
+          echo "FAILED: ${PATCHNAME}" >${TRIGGERFILE}
+          exit_err "Failed to download: ${PATCHNAME}"
+	fi
 
  	# Check the md5 checksum
         if [ "$FILEMD5" != "`md5 -q ${DOWNLOADDIR}/${FILENAME} 2>/dev/null`" ]
@@ -494,6 +493,11 @@
 
 	  # Download the file
 	  get_file "${MIRRORDIR}/$dFile" "${STAGEDIR}/$dFile" 3
+	  if [ $? -ne 0 ] ; then
+	    rm ${STAGEDIR}/$dFile >/dev/null 2>/dev/null
+            echo "FAILED: ${up}" >${TRIGGERFILE}
+            exit_err "Failed to download: ${MIRRORDIR}/${dFile}"
+	  fi
 	done
 
 	# Verify the md5 sums of .txz files
@@ -541,9 +545,17 @@
 
 	  # Download the file
 	  get_file "${MIRRORDIR}/metapackages/${PKGSET}/packages/${dFile}.txz" "${STAGEDIR}/packages/${dFile}.txz" 3
+ 	  if [ $? -ne 0 ] ; then
+             echo "FAILED: ${dFile}.txz" >${TRIGGERFILE}
+             exit_err "Failed to download: ${STAGEDIR}/packages/${dFile}.txz"
+ 	  fi
 
 	  # Download the sha256 file
 	  get_file "${MIRRORDIR}/metapackages/${PKGSET}/packages/${dFile}.txz.sha256" "${STAGEDIR}/packages/${dFile}.txz.sha256" 3
+ 	  if [ $? -ne 0 ] ; then
+             echo "FAILED: ${dFile}.txz.sha256" >${TRIGGERFILE}
+             exit_err "Failed to download: ${STAGEDIR}/packages/${dFile}.txz.sha256"
+ 	  fi
 
 	  # Confirm the sha256
 	  if [ "`sha256 -q ${STAGEDIR}/packages/${dFile}.txz`" !=  "`cat ${STAGEDIR}/packages/${dFile}.txz.sha256`" ] ; then



More information about the Commits mailing list