[d-i-commits] r32060 - in trunk/packages/apt-setup: . debian generators

Joey Hess joeyh at costa.debian.org
Tue Nov 15 01:20:54 UTC 2005


Author: joeyh
Date: 2005-11-15 01:20:52 +0000 (Tue, 15 Nov 2005)
New Revision: 32060

Modified:
   trunk/packages/apt-setup/TODO
   trunk/packages/apt-setup/apt-setup-verify
   trunk/packages/apt-setup/debian/apt-cdrom-setup.templates
   trunk/packages/apt-setup/debian/apt-mirror-setup.templates
   trunk/packages/apt-setup/debian/changelog
   trunk/packages/apt-setup/generators/50cdrom
   trunk/packages/apt-setup/generators/50mirror
Log:
 If setting up a mirror fails, allow the user to retry or change their
  mirror.
* If setting up a CD fails, let the user know there was a problem instead of
  quietly continuing without a main apt source.
* Add a comment before commented out lines to make clear why they are
  commented out.

Modified: trunk/packages/apt-setup/TODO
===================================================================
--- trunk/packages/apt-setup/TODO	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/TODO	2005-11-15 01:20:52 UTC (rev 32060)
@@ -7,5 +7,3 @@
   apt-mirror-setup which in turn pulls in choose-mirror, which is a menu
   item. Perhaps it's best to consider this behavior a feature though; it
   does need to choose a mirror at some point.
-- During a full CD install the same applies, but is certianly a bug there,
-  since it shouldn't need a mirror.

Modified: trunk/packages/apt-setup/apt-setup-verify
===================================================================
--- trunk/packages/apt-setup/apt-setup-verify	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/apt-setup-verify	2005-11-15 01:20:52 UTC (rev 32060)
@@ -45,6 +45,7 @@
 			gooditems=$(expr "$gooditems" + 1)
 			saveline "$line"
 		else
+			saveline "# Line commented out by installer because it failed to verify:"
 			saveline "#$line"
 		fi
 	else

Modified: trunk/packages/apt-setup/debian/apt-cdrom-setup.templates
===================================================================
--- trunk/packages/apt-setup/debian/apt-cdrom-setup.templates	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/debian/apt-cdrom-setup.templates	2005-11-15 01:20:52 UTC (rev 32060)
@@ -1,3 +1,9 @@
 Template: apt-setup/progress/cdrom
 Type: text
 _Description: Scanning the CD-ROM...
+
+Template: apt-setup/cdrom/failed
+Type: error
+_Description: apt configuration problem
+ An attempt to configure apt to install additional packages from the CD
+ failed.

Modified: trunk/packages/apt-setup/debian/apt-mirror-setup.templates
===================================================================
--- trunk/packages/apt-setup/debian/apt-mirror-setup.templates	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/debian/apt-mirror-setup.templates	2005-11-15 01:20:52 UTC (rev 32060)
@@ -23,3 +23,13 @@
  used to install it.
  .
  Please choose whether you want this software to be made available to you.
+
+Template: apt-setup/mirror/error
+Type: select
+Default: Retry
+_Choices: Retry, Change mirror, Ignore
+_Description: Downloading a file failed:
+ The installer failed to access the mirror. This may be a problem with your
+ network, or with the mirror. You can choose to retry the download, select
+ a different mirror, or ignore the problem and continue without all the
+ packages from this mirror.

Modified: trunk/packages/apt-setup/debian/changelog
===================================================================
--- trunk/packages/apt-setup/debian/changelog	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/debian/changelog	2005-11-15 01:20:52 UTC (rev 32060)
@@ -1,12 +1,21 @@
 apt-setup (1:0.2) UNRELEASED; urgency=low
 
+  [ Colin Watson ]
   * Add strings for Ubuntu mirror generator to translation infrastructure,
     per http://lists.debian.org/debian-boot/2005/10/msg01407.html and
     followups.
   * Clarify apt-setup/universe description a bit.
 
- -- Colin Watson <cjwatson at debian.org>  Mon, 14 Nov 2005 04:32:23 -0500
+  [ Joey Hess ]
+   If setting up a mirror fails, allow the user to retry or change their
+    mirror.
+  * If setting up a CD fails, let the user know there was a problem instead of
+    quietly continuing without a main apt source.
+  * Add a comment before commented out lines to make clear why they are
+    commented out.
 
+ -- Joey Hess <joeyh at debian.org>  Mon, 14 Nov 2005 20:20:45 -0500
+
 apt-setup (1:0.1) unstable; urgency=low
 
   [ Joey Hess ]

Modified: trunk/packages/apt-setup/generators/50cdrom
===================================================================
--- trunk/packages/apt-setup/generators/50cdrom	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/generators/50cdrom	2005-11-15 01:20:52 UTC (rev 32060)
@@ -19,3 +19,8 @@
 	</dev/null
 cat $ROOT$tmp >> $file
 rm -f $ROOT$tmp $ROOT$tmp~
+
+if ! apt-setup-verify $file; then
+	db_input critical apt-setup/cdrom/failed || true
+	db_go || exit 10
+fi

Modified: trunk/packages/apt-setup/generators/50mirror
===================================================================
--- trunk/packages/apt-setup/generators/50mirror	2005-11-15 00:14:16 UTC (rev 32059)
+++ trunk/packages/apt-setup/generators/50mirror	2005-11-15 01:20:52 UTC (rev 32060)
@@ -54,24 +54,42 @@
 	dists="$dists contrib"
 fi
 
-db_get mirror/suite
-suite="$RET"
-db_get mirror/protocol
-protocol="$RET"
-db_get mirror/$protocol/hostname
-hostname="$RET"
-db_get mirror/$protocol/directory
-directory="$RET"
+done=""
+while [ ! "$done" ]; do
+	db_get mirror/suite
+	suite="$RET"
+	db_get mirror/protocol
+	protocol="$RET"
+	db_get mirror/$protocol/hostname
+	hostname="$RET"
+	db_get mirror/$protocol/directory
+	directory="$RET"
 
-if [ "$protocol" = http ]; then
-	db_get mirror/$protocol/proxy
-	proxy="$RET"
-	if [ -n "$proxy" ]; then
-		if ! grep -iq "Acquire::$protocol::Proxy" $ROOT/etc/apt/apt.conf.new; then
-			echo "Acquire::$protocol::Proxy \"$proxy\";" >> $ROOT/etc/apt/apt.conf.new
+	if [ "$protocol" = http ]; then
+		db_get mirror/$protocol/proxy
+		proxy="$RET"
+		if [ -n "$proxy" ]; then
+			if ! grep -iq "Acquire::$protocol::Proxy" $ROOT/etc/apt/apt.conf.new; then
+				echo "Acquire::$protocol::Proxy \"$proxy\";" >> $ROOT/etc/apt/apt.conf.new
+			fi
 		fi
 	fi
-fi
 
-echo "deb $protocol://$hostname/$directory $suite $dists" >> $file
+	echo "deb $protocol://$hostname/$directory $suite $dists" > $file
+	
+	if apt-setup-verify $file; then
+		done=1
+	else
+		db_set apt-setup/mirror/error Retry
+		db_input critical apt-setup/mirror/error || true
+		db_go || exit 10
+		db_get apt-setup/mirror/error
+		if [ "$RET" = "Change mirror" ]; then
+			choose-mirror || true
+		elif [ "$RET" = Cancel ]; then
+			exit 1
+		fi
+	fi
+done
+
 echo "deb-src $protocol://$hostname/$directory $suite $dists" >> $file




More information about the d-i-commits mailing list