[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#439267: Post-install sources.list should contain commented-out generic URIs



tags 439267 + patch
thanks

Jérémy Bobbio wrote:

> Although it would probably be better to have a more local mirror than
> ftp.debian.org used, probably by using the country selected by the user
> at the beginning of the installation...

Agreed. I've attached a patch that does this.

I can see two problems with it, however:

 0. Arbitrary "gb -> uk"-like mappings may get crufty over time.
 1. Derivative distributions are kinda forced to have ".debian.org" in the
    hostname.


Regards,

-- 
Chris Lamb, UK                                       chris@chris-lamb.co.uk
                                                            GPG: 0x634F9A20
Index: packages/apt-setup/generators/50mirror
===================================================================
--- packages/apt-setup/generators/50mirror	(revision 51594)
+++ packages/apt-setup/generators/50mirror	(working copy)
@@ -96,20 +96,42 @@
 	# Only set default if not preseeded or already asked
 	# Hack alert: for this to work no default is set in template
 	db_get apt-setup/use_mirror
 	[ "$RET" ] || db_set apt-setup/use_mirror $use_mirror
 
 	db_input $use_prio apt-setup/use_mirror || [ $? -eq 30 ]
 	db_go || exit 10
 
 	db_get apt-setup/use_mirror
 	if [ "$RET" = false ]; then
+		# We aren't using a mirror; add commented-out URIs as a convenience
+		db_get cdrom/codename
+		codename="$RET"
+
+		db_get debian-installer/country || true
+		country=$(echo $RET | tr A-Z a-z)
+		case "$country" in
+		    gb)
+			# For some reason, there is no ftp.gb.debian.org.
+			prefix="ftp.uk"
+			;;
+		    *)
+			prefix="ftp.$country"
+			;;
+		    "")
+			prefix="ftp"
+			;;
+		esac
+
+		echo "#deb http://${prefix}.debian.org/debian $codename main" >> $file
+		echo "#deb-src http://${prefix}.debian.org/debian $codename main" >> $file
+
 		exit 1
 	fi
 
 	# Default suite to codename; choose-mirror will determine actual suite
 	if db_get cdrom/codename && [ "$RET" ]; then
 		db_set mirror/suite $RET
 	fi
 
 	while true; do
 		RET=0

Attachment: signature.asc
Description: PGP signature


Reply to: