[dpkg] 135/200: dpkg-genchanges: Fold dist filtering and checksumming into initial loop
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:17:29 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository dpkg.
commit fbc87b74543e9b20d9bcd6c85ec121db10bae523
Author: Guillem Jover <guillem at debian.org>
Date: Fri Dec 23 00:16:14 2016 +0100
dpkg-genchanges: Fold dist filtering and checksumming into initial loop
We should not include architectures for artifacts we are not going to
distribute. And we should not recompute the checksums for artifacts we
have already computed.
---
debian/changelog | 4 ++++
scripts/dpkg-genchanges.pl | 20 +++++++++-----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index abea4d0..06c2960 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,10 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
supported. Closes: #848705
* Add again the architecture from the filename to .changes files for any
artifact with one. This reverts the change introduced in dpkg 1.18.11.
+ * Fold the filtering and checksumming of files to distribute in a .changes
+ file in dpkg-genchanges into the initial loop. This way we do not include
+ architectures for artifacts we are not going to distribute, and do not
+ unnecessarily recompute the checksums for artifacts like the sources.
* Portability:
- On GNU/Hurd try to use the new process executable name attribute from
libps, to properly match on start-stop-daemon --exec.
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 745aaa0..ec6e3ef 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -309,16 +309,25 @@ error(g_('binary build with no binary artifacts found; cannot distribute'))
if build_has_any(BUILD_BINARY) && $dist_count == 0;
foreach my $file ($dist->get_files()) {
+ my $f = $file->{filename};
+
# If this is a source-only upload, ignore any other artifacts.
next if build_has_none(BUILD_BINARY);
if (defined $file->{arch}) {
+ my $arch_all = debarch_eq('all', $file->{arch});
+
+ next if build_has_none(BUILD_ARCH_INDEP) and $arch_all;
+ next if build_has_none(BUILD_ARCH_DEP) and not $arch_all;
+
push @archvalues, $file->{arch} if not $archadded{$file->{arch}}++;
}
if (defined $file->{package} && $file->{package_type} =~ m/^u?deb$/) {
$p2f{$file->{package}} //= [];
push @{$p2f{$file->{package}}}, $file->{filename};
}
+
+ $checksums->add_from_file("$uploadfilesdir/$f", key => $f);
}
# Scan control info of all binary packages
@@ -461,17 +470,6 @@ $fields->{'Description'} = "\n" . join("\n", sort @descriptions);
$fields->{'Files'} = '';
-for my $file ($dist->get_files()) {
- my $f = $file->{filename};
-
- if (defined $file->{package} && $file->{package_type} =~ m/^u?deb$/) {
- my $arch_all = debarch_eq('all', $file->{arch});
-
- next if build_has_none(BUILD_ARCH_INDEP) and $arch_all;
- next if build_has_none(BUILD_ARCH_DEP) and not $arch_all;
- }
- $checksums->add_from_file("$uploadfilesdir/$f", key => $f);
-}
foreach my $f ($checksums->get_files()) {
my $file = $dist->get_file($f);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list