From 2f34797490e328185e89972fafca4e2d15e5c2da Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Thu, 30 Oct 2014 02:12:12 +0000 Subject: [PATCH] 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! --- debian/changelog | 9 +++++++++ tools/make_disc_trees.pl | 24 +++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2ea4a5d3..2002426f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 [ Steve McIntyre ] diff --git a/tools/make_disc_trees.pl b/tools/make_disc_trees.pl index 6d2aa5bf..a3b7dff5 100755 --- a/tools/make_disc_trees.pl +++ b/tools/make_disc_trees.pl @@ -575,20 +575,33 @@ sub checksum_file { 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 { # Recompress various files my ($filename); $filename = $File::Find::name; - # Packages and Sources files; workaround for bug #402482 - if ($filename =~ m/\/.*\/(Packages|Sources)$/o) { + # Packages and Sources files; workaround for bug #402482 + if ($filename =~ m/\/.*\/(Packages|Sources)$/o) { 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 && - ! ($filename =~ m/\/.*\/i18n\/(Translation.*gz)$/o)) { - system("gzip -9 $_"); + ! ($filename =~ m/\/.*\/i18n\/(Translation.*gz)$/o)) { + system("gzip -9c < $_ >$_.gz"); } } @@ -829,6 +842,7 @@ sub finish_disc { find (\&recompress, "."); checksum_files_for_release(); close(RELEASE); + find (\&remove_uncompressed, "."); chdir("../.."); print " Finishing off md5sum.txt\n";