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

Bug#379502: localechooser fails in lowmem install



Quoting Frans Pop (elendil@planet.nl):
> severity 379502 serious
> thanks
> 
> As lowmem is a valid mode for the installer and even essential on some 
> arches, I'm raising this to RC. Probably nothing really breaks, but it 
> should be trivial to add appropriate tests.

Actually, the only possibility I see is the attached patch:

-test about validlocale
-only run the validlocale and locale generation stuff if it is there

I actually fail to see why validlocale wouldn't be here in lowmem mode
(supposedly we don't install the locale package) but that seems to be
the only short-term solution

This is completely untested.

-- 



--- post-base-installer.old	2006-07-24 06:45:28.206673304 +0200
+++ post-base-installer	2006-07-03 20:56:04.517661171 +0200
@@ -64,33 +64,31 @@
 fi
 
 # If the locale isn't already valid, append it to locale.gen
-if [ -x /target/usr/sbin/validlocale ] ; then 
-	gen=
+gen=
+if log-output -t localechooser --pass-stdout \
+    chroot /target/ /usr/sbin/validlocale "$LOCALE" \
+    >> /target/etc/locale.gen; then
+	: # Nothing to do
+else
+	# New locale added to locale.gen, generate it
+	gen=1
+fi
+for loc in $EXTRAS; do
+	if [ "$loc" = "$LOCALE" ]; then
+		continue
+	fi
 	if log-output -t localechooser --pass-stdout \
-	    chroot /target/ /usr/sbin/validlocale "$LOCALE" \
+	    chroot /target/ /usr/sbin/validlocale "$loc" \
 	    >> /target/etc/locale.gen; then
 		: # Nothing to do
 	else
 		# New locale added to locale.gen, generate it
 		gen=1
 	fi
-	for loc in $EXTRAS; do
-		if [ "$loc" = "$LOCALE" ]; then
-			continue
-		fi
-		if log-output -t localechooser --pass-stdout \
-		    chroot /target/ /usr/sbin/validlocale "$loc" \
-		    >> /target/etc/locale.gen; then
-			: # Nothing to do
-		else
-			# New locale added to locale.gen, generate it
-			gen=1
-		fi
-	done
-	if [ "$gen" ]; then
-		log-output -t localechooser --pass-stdout \
-		    chroot /target /usr/sbin/locale-gen --keep-existing >/dev/null
-	fi
+done
+if [ "$gen" ]; then
+	log-output -t localechooser --pass-stdout \
+	    chroot /target /usr/sbin/locale-gen --keep-existing >/dev/null
 fi
-	
+
 exit 0

Attachment: signature.asc
Description: Digital signature


Reply to: