From fe8aea1c3b5348347633da18a02b0bffd3b266a1 Mon Sep 17 00:00:00 2001 From: Perberos Date: Thu, 1 Dec 2011 21:42:39 -0300 Subject: moving from https://github.com/perberos/mate-desktop-environment --- data/check-timezones.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 data/check-timezones.sh (limited to 'data/check-timezones.sh') diff --git a/data/check-timezones.sh b/data/check-timezones.sh new file mode 100755 index 0000000..ab3bf08 --- /dev/null +++ b/data/check-timezones.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +if test -f /usr/share/zoneinfo/zone.tab; then + tzdb=/usr/share/zoneinfo/zone.tab +else + if test -f /usr/share/lib/zoneinfo/tab/zone_sun.tab; then + tzdb=/usr/share/lib/zoneinfo/tab/zone_sun.tab + else + echo "No timezone database found" + exit 1 + fi +fi + +locations=${1:-Locations.xml.in} +used=`mktemp` +correct=`mktemp` + +sed -ne 's/.*\(.*\)<.*/\1/p' $locations | sort -u > $used +awk '{print $3;}' $tzdb | sort -u > $correct +bad=`comm -13 $correct $used` +rm $correct $used + +if [ -n "$bad" ]; then + echo "Invalid timezones in ${locations}: $bad" 1>&2 + exit 1 +fi + +used=`mktemp` +obsolete=`mktemp` + +sed -ne 's/.*\(.*\)<.*/\1/p' $locations | sort -u > $used +sed -ne 's/.*\(.*\)<.*/\1/p' $locations | sort -u > $obsolete +bad=`comm -12 $used $obsolete` +rm $used $obsolete + +if [ -n "$bad" ]; then + echo "Obsolete timezones in ${locations}: $bad" 1>&2 + exit 1 +fi +exit 0 -- cgit v1.2.1