[PC-BSD Commits] r18845 - pcbsd/current/src-sh/pc-metapkgmanager

svn at pcbsd.org svn at pcbsd.org
Tue Sep 4 12:47:27 PDT 2012


Author: kris
Date: 2012-09-04 19:47:26 +0000 (Tue, 04 Sep 2012)
New Revision: 18845

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

Further improve pc-metapkgmanager, so that if fetch fails, we sleep then
retry. This fixes some issues with large sets of packages failing, like
KDE or GNOME. 



Modified: pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2012-09-04 18:28:33 UTC (rev 18844)
+++ pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2012-09-04 19:47:26 UTC (rev 18845)
@@ -115,7 +115,7 @@
 		   if [ ! -d "${_chroot}/$TMPDIR" ]; then mkdir -p "${_chroot}/$TMPDIR"; fi
 
 		   # Download all the packages first
-		   get_file "${MIRRORURL}/${pkg}.txz" "${_chroot}/${TMPDIR}/${pkg}.txz" 
+		   get_file "${MIRRORURL}/${pkg}.txz" "${_chroot}/${TMPDIR}/${pkg}.txz" 3
 		   if [ $? -ne 0 ] ; then
 		      exit_err "Failed downloading: ${MIRRORURL}/${pkg}.txz"
 		   fi
@@ -660,7 +660,7 @@
   if [ ! -d "${_chroot}/$TMPDIR" ]; then mkdir -p "${_chroot}/$TMPDIR"; fi
 
   # Download all the packages first
-  get_file "${MIRRORURL}/${nPkg}.txz" "${_chroot}/${TMPDIR}/${pkg}.txz"
+  get_file "${MIRRORURL}/${nPkg}.txz" "${_chroot}/${TMPDIR}/${pkg}.txz" 3
   if [ $? -ne 0 ] ; then
       exit_err "Failed downloading: ${MIRRORURL}/${nPkg}.txz"
   fi
@@ -766,6 +766,8 @@
 get_file() {
 	_rf="${1}"
 	_lf="${2}"
+        _ftries=${3}
+	if [ -z "$_ftries" ] ; then _ftries=3; fi
 
 	if [ -e "${_lf}" ] ; then 
 		echo "Resuming download of: ${_lf}"
@@ -809,6 +811,12 @@
 	fi
 
 	echo ""
+	if [ $_err -ne 0 -a $_ftries -gt 0 ] ; then
+		sleep 30
+		_ftries=`expr $_ftries - 1`
+		get_file "${_rf}" "${_lf}" $_ftries	
+		_err=$?
+	fi
 	return $_err
 }
 



More information about the Commits mailing list