[pkg-wpa-devel] r1418 - /crda/trunk/debian/crda.postinst

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Sun Aug 16 11:14:17 UTC 2009


Author: kelmo-guest
Date: Sun Aug 16 11:14:17 2009
New Revision: 1418

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1418
Log:
Ensure only valid sh can be generated even if zone.tab format changes (very unlikely) and remove redundant syntax check.

Modified:
    crda/trunk/debian/crda.postinst

Modified: crda/trunk/debian/crda.postinst
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/crda.postinst?rev=1418&op=diff
==============================================================================
--- crda/trunk/debian/crda.postinst (original)
+++ crda/trunk/debian/crda.postinst Sun Aug 16 11:14:17 2009
@@ -40,12 +40,15 @@
 	# output something which can be sourced by a shell script. This is
 	# done here to avoid overhead at crda udev agent runtime and to
 	# allow data to be available in early boot.
-	awk -v start="$START" -v end="$END" -v tzconf="$TZCONF" '
+	awk -v start="$START" -v end="$END" -v input="$1" -v tzconf="$TZCONF" '
 	BEGIN {
 		printf("%s\n", start)
 		printf("#\n")
 		printf("# Lines between the AUTOGENERATED markers are managed by crda maintainer\n")
 		printf("# scripts. Do not edit between the markers, all changes will be lost.\n")
+		printf("#\n")
+		printf("# This country description <-> ISO 3166 country code matrix is kept in sync\n")
+		printf("# (via dpkg trigger) with %s\n", input)
 		printf("#\n")
 		printf("if [ -z \"$REGDOMAIN\" ]; then\n")
 		printf("\tTIMEZONE=$(sed \"s# #_#g\" %s 2>/dev/null)\n", tzconf)
@@ -53,7 +56,7 @@
 	}
 	$1 ~ /^[A-Z][A-Z]$/ {
 		printf("\t\t\"%s\")\n", $3)
-		printf("\t\t\tREGDOMAIN=%s\n", $1)
+		printf("\t\t\tREGDOMAIN=\"%s\"\n", $1)
 		printf("\t\t\t;;\n")
 	}
 	END {
@@ -64,15 +67,7 @@
 	}
 	' "$1" >> /etc/default/crda.postinst.tmp
 
-	# Check syntax of autogenerated data. Do not overwrite the current
-	# /etc/default/crda conffile if a problem is detected by a sh dry run.
-	if sh -n /etc/default/crda.postinst.tmp; then
-		mv -f /etc/default/crda.postinst.tmp /etc/default/crda
-	else
-		echo "$0: syntax check failed, /etc/default/crda not" 1>&2
-		echo "$0: in sync with tzdata ISO 3166 country codes" 1>&2
-		rm -f /etc/default/crda.postinst.tmp
-	fi
+	mv -f /etc/default/crda.postinst.tmp /etc/default/crda
 }
 
 case "$1" in




More information about the Pkg-wpa-devel mailing list