diff options
author | Simon Paillard <spaillard@debian.org> | 2013-05-15 01:26:00 +0200 |
---|---|---|
committer | Simon Paillard <spaillard@debian.org> | 2013-05-15 01:26:00 +0200 |
commit | 45e4a640d7cf088878f24164c9a67f821d5b71ed (patch) | |
tree | 727edbd9357927d31eb002bc1f19011fefa02ebd | |
parent | 704de6f45cbdc248592361489f09c684d1a4fac2 (diff) |
Do not process symlinks Contents-*.gz
Some dists have a symlink Contents-$arch.gz -> main/Contents-$arch.gz
As main section is processed as such, exclude symlinked contents from
processing.
Linked to commit 864f512550c778b02b409dd94859ce6539dc62f3
Contents-$arch.gz under dists/$DIST/$SECTION/
-rwxr-xr-x | bin/parse-contents | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/parse-contents b/bin/parse-contents index 78ed7f5..0a7f0a7 100755 --- a/bin/parse-contents +++ b/bin/parse-contents @@ -77,6 +77,12 @@ for my $suite (@suites) { my $filename = "$TOPDIR/archive/$archive/$suite/$section/Contents-$arch.gz"; next unless -f $filename; + + if (-l $filename) { + print "Skipping link $archive/$suite/$section/Contents-$arch.gz\n"; + next ; # do not process symlinks, or we will have double data + } + # Note: ctime, because mtime is set back via rsync my $ftime = (stat $filename)[10]; next if defined $dbtime and $dbtime > $ftime; @@ -90,6 +96,12 @@ for my $suite (@suites) { my $filename = "$TOPDIR/archive/$archive/$suite/$section/Contents-$arch.gz"; next unless -f $filename; + + if (-l $filename) { + print "Skipping link $archive/$suite/$section/Contents-$arch.gz\n"; + next ; # do not process symlinks, or we will have double data + } + print "Reading $archive/$suite/$section/$arch...\n"; open CONT, "zcat $filename|$what" |