[Glibc-bsd-commits] r4657 - trunk/kfreebsd-downloader/debian

rmh at alioth.debian.org rmh at alioth.debian.org
Mon Jul 8 12:48:30 UTC 2013


Author: rmh
Date: 2013-07-01 21:54:48 +0000 (Mon, 01 Jul 2013)
New Revision: 4657

Modified:
   trunk/kfreebsd-downloader/debian/changelog
   trunk/kfreebsd-downloader/debian/postinst.in
Log:
postinst.in: Try all URLs until one succeeds.

Modified: trunk/kfreebsd-downloader/debian/changelog
===================================================================
--- trunk/kfreebsd-downloader/debian/changelog	2013-06-30 23:18:44 UTC (rev 4656)
+++ trunk/kfreebsd-downloader/debian/changelog	2013-07-01 21:54:48 UTC (rev 4657)
@@ -1,3 +1,9 @@
+kfreebsd-downloader (9.0-5) UNRELEASED; urgency=low
+
+  * postinst.in: Try all URLs until one succeeds.
+
+ -- Robert Millan <rmh at debian.org>  Mon, 01 Jul 2013 23:53:34 +0200
+
 kfreebsd-downloader (9.0-4) unstable; urgency=high
 
   * Make it easier to upgrade by removing version number redundancy.

Modified: trunk/kfreebsd-downloader/debian/postinst.in
===================================================================
--- trunk/kfreebsd-downloader/debian/postinst.in	2013-06-30 23:18:44 UTC (rev 4656)
+++ trunk/kfreebsd-downloader/debian/postinst.in	2013-07-01 21:54:48 UTC (rev 4657)
@@ -21,10 +21,6 @@
 KERNEL_IMG_CONF="/etc/kernel-img.conf"
 MANIFEST="/usr/share/kfreebsd-downloader/@VERSION@/MANIFEST. at ARCH@"
 
-#BASE_URL="http://ftp.freebsd.org/pub/FreeBSD/releases/@ARCH@/@ARCH@/@VERSION@-RELEASE"
-#BASE_URL="http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/@ARCH@/@ARCH@/@VERSION@-RELEASE"
-BASE_URL="http://people.debian.org/~rmh/kfreebsd-downloader/@ARCH@/@VERSION@-RELEASE"
-
 case "$1" in
     configure)
 	cachedir="/var/cache/kfreebsd-downloader/@VERSION at -RELEASE"
@@ -32,7 +28,18 @@
 
 	# Download
 	mkdir -p ${cachedir}
-	wget ${BASE_URL}/kernel.txz -c -O ${cachedir}/kernel.txz
+	found=false
+	for base_url in \
+		http://ftp.freebsd.org/pub/FreeBSD/releases/@ARCH@/@ARCH@/@VERSION@-RELEASE \
+		http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/@ARCH@/@ARCH@/@VERSION@-RELEASE \
+		http://people.debian.org/~rmh/kfreebsd-downloader/@ARCH@/@VERSION@-RELEASE \
+	; do
+		if wget ${base_url}/kernel.txz -c -O ${cachedir}/kernel.txz ; then
+			found=true
+			break
+		fi
+	done
+	${found}
 
 	# Verify
 	grep "^kernel\.txz\s" ${MANIFEST} | (read file sum dummy; sha256sum ${cachedir}/kernel.txz | grep "^${sum}\s")




More information about the Glibc-bsd-commits mailing list