- Applied patch for feature #1005, which prevents the update-holidays.pl script
  from creating duplicate holidays (thanks to Jörg Plate).

Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
Jörg Plate 2012-05-07 18:44:14 -04:00 committed by Paul Beckingham
parent a15be33713
commit 26420d74c2
3 changed files with 5 additions and 0 deletions

View file

@ -161,6 +161,7 @@ exit (1) if !defined $data || $data eq '';
# Filter the holidays according to @regions.
my $id = 1;
my $content;
my %seen;
for my $holiday (split /\n/ms, $data)
{
my $parsed = from_json ($holiday);
@ -172,6 +173,7 @@ for my $holiday (split /\n/ms, $data)
(@regions > 0 && ($parsed->{'region'} eq '' ||
exists $region_hash{$parsed->{'region'}})))
{
next if $seen{ $parsed->{'description'} . ':' . $parsed->{'date'} }++;
$content .= "holiday.${locale}${id}.name=" . $parsed->{'description'} . "\n" .
"holiday.${locale}${id}.date=" . $parsed->{'date'} . "\n";
}