[Reproducible-builds] [debhelper] 04/06: Add a new program, dh_genbuildinfo, to generate a .buildinfo file after build

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Sep 19 15:59:14 UTC 2014


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

lunar pushed a commit to branch pu/reproducible_builds
in repository debhelper.

commit 4dec5e5b2d048ea4f1c3ee122adde38b97c01d12
Author: Niko Tyni <ntyni at debian.org>
Date:   Sat Aug 30 20:14:18 2014 -0700

    Add a new program, dh_genbuildinfo, to generate a .buildinfo file after build
    
    This is a proof of concept. The functionality should probably be in a
    "dpkg-genbuildinfo" program instead, but we're putting it in debhelper
    for now to reduce the number of patched packages needed by the "Debian
    Reproducible Builds" effort.
    
    This wrapper is separate from gen-buildinfo, which it leverages on,
    because that one could realistically be merged into the dh-buildinfo
    package.
---
 dh_genbuildinfo | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/dh_genbuildinfo b/dh_genbuildinfo
new file mode 100755
index 0000000..48b3cd4
--- /dev/null
+++ b/dh_genbuildinfo
@@ -0,0 +1,80 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_genbuildinfo - generate a .buildinfo file
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_genbuildinfo> [S<I<debhelper options>>] [B<--destdir=>I<directory>] [B<--filename=>I<name>] [S<B<--> I<params>>]
+
+=head1 DESCRIPTION
+
+B<dh_genbuildinfo> calls L<dpkg-genchanges(1)> and
+L<dh_buildinfo(1)> via I</usr/share/debhelper/gen-buildinfo>
+to generate a I<.buildinfo> file as specified in
+L<https://wiki.debian.org/ReproducibleBuilds#Recording_the_environment>
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--destdir=>I<directory>
+
+Use this if you want the generated F<.buildinfo> file to be put in a directory
+other than the default of "F<..>".
+
+=item B<--filename=>I<name>
+
+Use this if you want to force the generated .buildinfo file to have a particular
+file name.
+
+=back
+
+=cut
+
+init(options => {
+	"filename=s" => \$dh{FILENAME},
+	"destdir=s" => \$dh{DESTDIR},
+});
+
+# Set the default destination directory.
+if (! defined $dh{DESTDIR}) {
+	$dh{DESTDIR}='..';
+}
+
+my $package = sourcepackage();
+isnative($package); # side effect
+my $version=$dh{VERSION};
+my $arch = dpkg_architecture_value('DEB_HOST_ARCH');
+
+if (! defined $dh{FILENAME}) {
+	$dh{FILENAME}= "${package}_${version}_${arch}.buildinfo";
+}
+else {
+	$dh{FILENAME}="/$dh{FILENAME}";
+}
+
+my $gen = "/usr/share/debhelper/gen-buildinfo";
+$gen = "./gen-buildinfo" if $package eq 'debhelper';
+
+complex_doit("$gen > $dh{DESTDIR}/$dh{FILENAME}");
+
+exit 0;
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+This program is intended to be a part of debhelper.
+
+=head1 AUTHOR
+
+Niko Tyni <ntyni at debian.org>, based on L<dh_builddep(1)>
+
+=cut

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debhelper.git



More information about the Reproducible-builds mailing list