Annotation of /trunk/installer/include/timezone.sh
Parent Directory | Revision Log
Revision 773 -
(hide annotations)
(download)
(as text)
Wed Sep 24 10:54:00 2008 UTC (16 years ago) by niro
File MIME type: application/x-sh
File size: 1033 byte(s)
Wed Sep 24 10:54:00 2008 UTC (16 years ago) by niro
File MIME type: application/x-sh
File size: 1033 byte(s)
-moved helper-scripts into include/ directory
1 | niro | 773 | #!/bin/bash |
2 | # $Header: /home/cvsd/magellan-cvs/magellan-src/installer/include/timezone.sh,v 1.1 2008-09-24 10:54:00 niro Exp $ | ||
3 | |||
4 | checklist() | ||
5 | { | ||
6 | local i | ||
7 | local item="$1" | ||
8 | |||
9 | for i in ${LOCALE_LIST} | ||
10 | do | ||
11 | [[ ${i} = ${item} ]] && return 1 | ||
12 | done | ||
13 | |||
14 | return 0 | ||
15 | } | ||
16 | |||
17 | |||
18 | while read code coordinates tz comments | ||
19 | do | ||
20 | # excludes | ||
21 | case ${code} in | ||
22 | \#*|'') continue ;; | ||
23 | esac | ||
24 | |||
25 | region="${tz%%/*}" | ||
26 | location="${tz#*/}" | ||
27 | |||
28 | if [[ $1 = --regions ]] | ||
29 | then | ||
30 | if checklist "${region}" | ||
31 | then | ||
32 | LOCALE_LIST="${LOCALE_LIST} ${region}" | ||
33 | fi | ||
34 | |||
35 | elif [[ $1 = --locations ]] | ||
36 | then | ||
37 | [[ ${region} != $2 ]] && continue | ||
38 | if checklist "${location}" | ||
39 | then | ||
40 | LOCALE_LIST="${LOCALE_LIST} ${location}" | ||
41 | fi | ||
42 | |||
43 | elif [[ $1 = --get-code ]] | ||
44 | then | ||
45 | [[ ${location} != $2 ]] && continue | ||
46 | # location is the same, so print the code | ||
47 | echo "${code}" | ||
48 | |||
49 | elif [[ -z $1 ]] | ||
50 | then | ||
51 | echo "${tz}|${comments}" | ||
52 | fi | ||
53 | |||
54 | done << EOF | ||
55 | $(cat /usr/share/zoneinfo/zone.tab | sort) | ||
56 | EOF | ||
57 | |||
58 | |||
59 | if [[ $1 = --regions ]] || [[ $1 = --locations ]] | ||
60 | then | ||
61 | for i in ${LOCALE_LIST} | ||
62 | do | ||
63 | echo "${i}" | ||
64 | done | sort | ||
65 | fi |
Properties
Name | Value |
---|---|
svn:executable | * |