[pkg-wpa-devel] r1393 - in /crda/trunk/debian: parse_zone_tab rules
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Sun May 17 19:25:22 UTC 2009
Author: kelmo-guest
Date: Sun May 17 19:25:22 2009
New Revision: 1393
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1393
Log:
Move zone.tab parsing to own script.
Added:
crda/trunk/debian/parse_zone_tab
Modified:
crda/trunk/debian/rules
Added: crda/trunk/debian/parse_zone_tab
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/parse_zone_tab?rev=1393&op=file
==============================================================================
--- crda/trunk/debian/parse_zone_tab (added)
+++ crda/trunk/debian/parse_zone_tab Sun May 17 19:25:22 2009
@@ -1,0 +1,32 @@
+#!/bin/sh
+set -e
+
+#
+# Parse tzdata's zone.tab and create a mapping of timezone name -> ISO 3166
+# 2-character country code which can be sourced by setregdomain shell script
+#
+
+if [ $# -ne 1 ]; then
+ echo "Usage: $0 <output file>" >&2
+ exit 1
+fi
+
+if [ ! -s /usr/share/zoneinfo/zone.tab ]; then
+ echo "Error: /usr/share/zoneinfo/zone.tab not installed" >&2
+ exit 1
+fi
+
+awk '
+ BEGIN {
+ printf("case $TIME_ZONE in\n")
+ }
+ $1 ~ /^[A-Z][A-Z]$/ {
+ printf("\t\"%s\")\n\t\tZONE_CODE=%s\n\t\t;;\n", $3, $1)
+ }
+ END{
+ printf("esac\n")
+ }
+' /usr/share/zoneinfo/zone.tab > $1
+
+# Verify it is valid shell code
+sh -n $1
Modified: crda/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/rules?rev=1393&op=diff
==============================================================================
--- crda/trunk/debian/rules (original)
+++ crda/trunk/debian/rules Sun May 17 19:25:22 2009
@@ -9,16 +9,8 @@
override_dh_install:
dh_install
- @# Install a pre-parsed mapping of location name -> zone code
- @# which can be sourced by sh
- awk 'BEGIN{ printf("case $$TIME_ZONE in\n") } \
- $$1 ~ /^[A-Z][A-Z]$$/{ \
- printf("\t\"%s\")\n\t\tZONE_CODE=%s\n\t\t;;\n", $$3, $$1) \
- } \
- END{ printf("esac\n") }' /usr/share/zoneinfo/zone.tab > \
- debian/crda/lib/crda/setregdomain_zone_codes
- @# Verify it is valid sh
- sh -n debian/crda/lib/crda/setregdomain_zone_codes
+ chmod a+rx debian/parse_zone_tab
+ debian/parse_zone_tab debian/crda/lib/crda/setregdomain_zone_codes
override_dh_fixperms:
dh_fixperms
More information about the Pkg-wpa-devel
mailing list