Skip to content

Commit ef4b8a5

Browse files
committed
Start with 2000f, which is the first release that seems to be compatible with vzic.
1 parent 07f90f8 commit ef4b8a5

File tree

3 files changed

+49
-8
lines changed

3 files changed

+49
-8
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11

22
# don't modify the line endings of generated zoneinfo files (they use CRLF according to the specification).
33
/zoneinfo/** text eol=crlf
4+
5+
/settings.config text eol=lf

settings.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
VZIC_RELEASE_NAME=
2+
VZIC_RELEASE_NAME=2000f
33
VZIC_BASE_RELEASE_NAME=
44

55
# The source tzdata is downloaded from this URL.

vzic-merge.pl

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,36 @@
7676

7777
$copy_to_master = 0;
7878

79-
# If the ics file exists in the master copy we have to compare them,
80-
# otherwise we can just copy the new file into the master directory.
81-
if (-e $master_file) {
79+
if (-l $new_file) {
80+
# This is a symlink, copy it in any case.
81+
82+
if (!-e $master_file) {
83+
print "Creating new symlinkg $new_file...\n";
84+
$copy_to_master = 1;
85+
} elsif (-l $master_file) {
86+
my $src = readlink($master_file);
87+
my $dst = readlink($new_file);
88+
89+
if ($src eq $dst) {
90+
$copy_to_master = 0;
91+
# print "Symlink $new_file unchanged: $src.\n"
92+
} else {
93+
print "Updating symlink $new_file to $src...\n";
94+
$copy_to_master = 1;
95+
}
96+
97+
} else {
98+
print "Changing $new_file to symlink...\n";
99+
$copy_to_master = 1;
100+
}
101+
102+
} elsif (-l $master_file) {
103+
$copy_to_master = 1;
104+
print "Changing $new_file from symlink to real file...\n";
105+
106+
} elsif (-e $master_file) {
107+
# If the ics file exists in the master copy we have to compare them,
108+
# otherwise we can just copy the new file into the master directory.
82109
open (MASTERZONEFILE, "$master_file")
83110
|| die "Can't open file: $master_file";
84111
undef $/;
@@ -131,10 +158,22 @@
131158
make_path $directories or die "Failed to create path: $directories";
132159
}
133160

134-
open (MASTERZONEFILE, ">$master_file")
135-
|| die "Can't create file: $master_file";
136-
print MASTERZONEFILE $new_contents;
137-
close (MASTERZONEFILE);
161+
if ( -e $master_file ) {
162+
# delete old file so we don't have issues with symlinks
163+
unlink($master_file)
164+
}
165+
166+
if ( -l $new_file ) {
167+
my $dst = readlink($new_file) || die "Can't read symlink $new_file.";
168+
169+
print "Creating symlink to $dst in $master_file.\n";
170+
symlink $dst, $master_file || die "Can't create symlink $new_file.";
171+
} else {
172+
open (MASTERZONEFILE, ">$master_file")
173+
|| die "Can't create file: $master_file";
174+
print MASTERZONEFILE $new_contents;
175+
close (MASTERZONEFILE);
176+
}
138177
}
139178
}
140179
}

0 commit comments

Comments
 (0)