Tweak handling of (un)compressed index files

Provide hashes for uncompressed Translation-* files, and remove the
uncompressed versions from the output disc. Closes: #767253. Initial
patch from Michael Vogt - thanks!
This commit is contained in:
Steve McIntyre 2014-10-30 02:12:12 +00:00
parent 3fccac5364
commit 2f34797490
2 changed files with 28 additions and 5 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
debian-cd (3.1.17) UNRELEASED; urgency=medium
[ Steve McIntyre ]
* Provide hashes for uncompressed Translation-* files, and remove the
uncompressed versions from the output disc. Closes: #767253. Initial
patch from Michael Vogt - thanks!
-- Steve McIntyre <93sam@debian.org> Wed, 29 Oct 2014 17:33:10 +0000
debian-cd (3.1.16) unstable; urgency=medium debian-cd (3.1.16) unstable; urgency=medium
[ Steve McIntyre ] [ Steve McIntyre ]

View File

@ -575,20 +575,33 @@ sub checksum_file {
return ($checksum, $st->size); return ($checksum, $st->size);
} }
sub remove_uncompressed {
my ($filename);
$filename = $File::Find::name;
print "remove_uncompressed: looking at $filename\n";
if ($filename =~ m/\/.*\/(Packages|Sources)$/o ||
$filename =~ m/\/.*\/i18n\/(Translation-[_a-zA-Z]+)$/o)
{
unlink($_) or die "Failed to remove $_: $!\n";
}
}
sub recompress { sub recompress {
# Recompress various files # Recompress various files
my ($filename); my ($filename);
$filename = $File::Find::name; $filename = $File::Find::name;
# Packages and Sources files; workaround for bug #402482 # Packages and Sources files; workaround for bug #402482
if ($filename =~ m/\/.*\/(Packages|Sources)$/o) { if ($filename =~ m/\/.*\/(Packages|Sources)$/o) {
system("gzip -9c < $_ >$_.gz"); system("gzip -9c < $_ >$_.gz");
} }
# Translation files need to be compressed in .gz format on CD? # Translation files need to be compressed in .gz format on CD?
if ($filename =~ m/\/.*\/i18n\/(Translation.*)$/o && if ($filename =~ m/\/.*\/i18n\/(Translation.*)$/o &&
! ($filename =~ m/\/.*\/i18n\/(Translation.*gz)$/o)) { ! ($filename =~ m/\/.*\/i18n\/(Translation.*gz)$/o)) {
system("gzip -9 $_"); system("gzip -9c < $_ >$_.gz");
} }
} }
@ -829,6 +842,7 @@ sub finish_disc {
find (\&recompress, "."); find (\&recompress, ".");
checksum_files_for_release(); checksum_files_for_release();
close(RELEASE); close(RELEASE);
find (\&remove_uncompressed, ".");
chdir("../.."); chdir("../..");
print " Finishing off md5sum.txt\n"; print " Finishing off md5sum.txt\n";