This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=3eca339ccdd14f2812ca252fd4243fdfeac9ad1d

commit 3eca339ccdd14f2812ca252fd4243fdfeac9ad1d (HEAD -> main)
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Aug 17 00:54:47 2016 +0200

    dpkg-buildpackage: Reference the .dsc in .buildinfo if building from one
    
    If we have been passed a .dsc filename as an argument, so that we have
    extracted it, we can then tell dpkg-genbuildinfo to include references
    to the source package, as we can ascertain the provenance of the source
    tree.
    
    Closes: #882511
---
 man/dpkg-buildpackage.pod    |  3 +++
 scripts/dpkg-buildpackage.pl | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/man/dpkg-buildpackage.pod b/man/dpkg-buildpackage.pod
index 555b2b53d..402c296dd 100644
--- a/man/dpkg-buildpackage.pod
+++ b/man/dpkg-buildpackage.pod
@@ -95,6 +95,9 @@ It runs the B<buildinfo>
 hook and calls B<dpkg-genbuildinfo> to generate a B<.buildinfo> file.
 Several B<dpkg-buildpackage> options are forwarded to
 B<dpkg-genbuildinfo>.
+If a I<.dsc> has been specified,
+then it will be referenced in the generated B<.buildinfo> file,
+as we can ascertain the provenance of the source tree.
 
 =item B<7.>
 
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 8800f0805..d849d6e90 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -735,7 +735,16 @@ if (build_has_any(BUILD_BINARY)) {
 
 $buildinfo_file //= "../$pva.buildinfo";
 
-push @buildinfo_opts, "--build=$build_types" if build_has_none(BUILD_DEFAULT);
+if (build_has_none(BUILD_DEFAULT) || $source_from_dsc) {
+    my $buildinfo_buildtypes = $build_types;
+
+    # We can now let dpkg-genbuildinfo know that we can include the .dsc
+    # in the .buildinfo file as we handled it ourselves, and what we are
+    # building matches either the source we built or extracted it from.
+    $buildinfo_buildtypes .= ',source' if $source_from_dsc;
+
+    push @buildinfo_opts, "--build=$buildinfo_buildtypes";
+}
 push @buildinfo_opts, "--admindir=$admindir" if $admindir;
 push @buildinfo_opts, "-O$buildinfo_file" if $buildinfo_file;
 

-- 
Dpkg.Org's dpkg

Reply via email to