~ubuntu-branches/ubuntu/vivid/tzdata/vivid-proposed

« back to all changes in this revision

Viewing changes to checklinks.awk

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2015-10-20 11:01:03 UTC
  • mfrom: (1.7.47)
  • Revision ID: package-import@ubuntu.com-20151020110103-puka278ulnwuzpyi
Tags: 2015g-0ubuntu0.15.04
New upstream release with future timestamp updates for Fiji, Norfolk 
Island, and Turkey, and a new timezone for Fort Nelson (LP: #1502058)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Contributed by Paul Eggert.
4
4
 
5
 
/^Link/ { used[$2] = 1 }
6
 
/^Zone/ { defined[$2] = 1 }
 
5
BEGIN {
 
6
    # Special marker indicating that the name is defined as a Zone.
 
7
    # It is a newline so that it cannot match a valid name.
 
8
    # It is not null so that its slot does not appear unset.
 
9
    Zone = "\n"
 
10
}
 
11
 
 
12
/^Zone/ {
 
13
    if (defined[$2]) {
 
14
        if (defined[$2] == Zone) {
 
15
            printf "%s: Zone has duplicate definition\n", $2
 
16
        } else {
 
17
            printf "%s: Link with same name as Zone\n", $2
 
18
        }
 
19
        status = 1
 
20
    }
 
21
    defined[$2] = Zone
 
22
}
 
23
 
 
24
/^Link/ {
 
25
    if (defined[$3]) {
 
26
        if (defined[$3] == Zone) {
 
27
            printf "%s: Link with same name as Zone\n", $3
 
28
        } else if (defined[$3] == $2) {
 
29
            printf "%s: Link has duplicate definition\n", $3
 
30
        } else {
 
31
            printf "%s: Link to both %s and %s\n", $3, defined[$3], $2
 
32
        }
 
33
        status = 1
 
34
    }
 
35
    used[$2] = 1
 
36
    defined[$3] = $2
 
37
}
7
38
 
8
39
END {
9
 
    status = 0
10
 
 
11
40
    for (tz in used) {
12
 
        if (!defined[tz]) {
 
41
        if (defined[tz] != Zone) {
13
42
            printf "%s: Link to non-zone\n", tz
14
43
            status = 1
15
44
        }