diff options
author | Guillem Jover <guillem@debian.org> | 2016-11-01 06:21:18 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-11-03 06:03:35 +0100 |
commit | ee8975322f93e41ccd5787ebb6cadaecc81cadf3 (patch) | |
tree | 9f54df5e375e2c177c00b681717d5de44a56807a /scripts/Dpkg/Control | |
parent | f89e053f3e3a6f0f73a9ce2c8dd2c72db93d44bb (diff) | |
download | dpkg-ee8975322f93e41ccd5787ebb6cadaecc81cadf3.tar.gz |
scripts: Add support for .buildinfo files
The .buildinfo files are a new type of control files, similar to
the .changes files, meant to describe the environment of a build
and its artifacts. They are meant to be added to the Debian archive
to allow independent parties to reproduce a build and verify the
result.
Specifications for .buildinfo are available at:
<https://wiki.debian.org/ReproducibleBuilds/BuildinfoSpecification>
This patch adds support for .buildinfo files in Dpkg::Control,
adds new .buildinfo fields to Dpkg::Control::Fields, a new
builtin-system-build-paths Dpkg::Vendor hook, and adds a new script
named dpkg-genbuildinfo, that will now be called by dpkg-buildpackage
before generating the .changes file.
[ntyni@debian.org: small changes. ]
Closes: #138409
Based-on-patch-by: Jérémy Bobbio <lunar@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
Diffstat (limited to 'scripts/Dpkg/Control')
-rw-r--r-- | scripts/Dpkg/Control/FieldsCore.pm | 41 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Types.pm | 3 |
2 files changed, 38 insertions, 6 deletions
diff --git a/scripts/Dpkg/Control/FieldsCore.pm b/scripts/Dpkg/Control/FieldsCore.pm index bbc19aa83..4c0ae50c8 100644 --- a/scripts/Dpkg/Control/FieldsCore.pm +++ b/scripts/Dpkg/Control/FieldsCore.pm @@ -66,7 +66,7 @@ use constant { # Deprecated fields of dpkg's status file are also not listed our %FIELDS = ( 'Architecture' => { - allowed => (ALL_PKG | ALL_SRC | CTRL_FILE_CHANGES) & (~CTRL_INFO_SRC), + allowed => (ALL_PKG | ALL_SRC | CTRL_FILE_BUILDINFO | CTRL_FILE_CHANGES) & (~CTRL_INFO_SRC), separator => FIELD_SEP_SPACE, }, 'Architectures' => { @@ -74,7 +74,7 @@ our %FIELDS = ( separator => FIELD_SEP_SPACE, }, 'Binary' => { - allowed => CTRL_PKG_SRC | CTRL_FILE_CHANGES, + allowed => CTRL_PKG_SRC | CTRL_FILE_BUILDINFO | CTRL_FILE_CHANGES, # XXX: This field values are separated either by space or comma # depending on the context. separator => FIELD_SEP_SPACE | FIELD_SEP_COMMA, @@ -82,6 +82,9 @@ our %FIELDS = ( 'Binary-Only' => { allowed => ALL_CHANGES, }, + 'Binary-Only-Changes' => { + allowed => CTRL_FILE_BUILDINFO, + }, 'Breaks' => { allowed => ALL_PKG, separator => FIELD_SEP_COMMA, @@ -91,6 +94,9 @@ our %FIELDS = ( 'Bugs' => { allowed => (ALL_PKG | CTRL_INFO_SRC | CTRL_FILE_VENDOR) & (~CTRL_INFO_PKG), }, + 'Build-Architecture' => { + allowed => CTRL_FILE_BUILDINFO, + }, 'Build-Conflicts' => { allowed => ALL_SRC, separator => FIELD_SEP_COMMA, @@ -130,6 +136,12 @@ our %FIELDS = ( 'Build-Essential' => { allowed => ALL_PKG, }, + 'Build-Origin' => { + allowed => CTRL_FILE_BUILDINFO, + }, + 'Build-Path' => { + allowed => CTRL_FILE_BUILDINFO, + }, 'Build-Profiles' => { allowed => CTRL_INFO_PKG, separator => FIELD_SEP_SPACE, @@ -214,6 +226,10 @@ our %FIELDS = ( dependency => 'union', dep_order => 5, }, + 'Environment' => { + allowed => CTRL_FILE_BUILDINFO, + separator => FIELD_SEP_LINE, + }, 'Essential' => { allowed => ALL_PKG, }, @@ -230,11 +246,17 @@ our %FIELDS = ( separator => FIELD_SEP_LINE | FIELD_SEP_SPACE, }, 'Format' => { - allowed => CTRL_PKG_SRC | CTRL_FILE_CHANGES | CTRL_COPYRIGHT_HEADER, + allowed => CTRL_PKG_SRC | CTRL_FILE_CHANGES | CTRL_COPYRIGHT_HEADER | CTRL_FILE_BUILDINFO, }, 'Homepage' => { allowed => ALL_SRC | ALL_PKG, }, + 'Installed-Build-Depends' => { + allowed => CTRL_FILE_BUILDINFO, + separator => FIELD_SEP_COMMA, + dependency => 'union', + dep_order => 11, + }, 'Installed-Size' => { allowed => ALL_PKG & ~CTRL_INFO_PKG, }, @@ -311,7 +333,7 @@ our %FIELDS = ( separator => FIELD_SEP_LINE | FIELD_SEP_SPACE, }, 'Source' => { - allowed => (ALL_PKG | ALL_SRC | ALL_CHANGES | CTRL_COPYRIGHT_HEADER) & + allowed => (ALL_PKG | ALL_SRC | ALL_CHANGES | CTRL_COPYRIGHT_HEADER | CTRL_FILE_BUILDINFO) & (~(CTRL_INDEX_SRC | CTRL_INFO_PKG)), }, 'Standards-Version' => { @@ -419,7 +441,7 @@ our %FIELDS = ( allowed => CTRL_FILE_VENDOR, }, 'Version' => { - allowed => (ALL_PKG | ALL_SRC | ALL_CHANGES) & + allowed => (ALL_PKG | ALL_SRC | CTRL_FILE_BUILDINFO | ALL_CHANGES) & (~(CTRL_INFO_SRC | CTRL_INFO_PKG)), }, ); @@ -427,7 +449,7 @@ our %FIELDS = ( my @checksum_fields = map { &field_capitalize("Checksums-$_") } checksums_get_list(); my @sum_fields = map { $_ eq 'md5' ? 'MD5sum' : &field_capitalize($_) } checksums_get_list(); -&field_register($_, CTRL_PKG_SRC | CTRL_FILE_CHANGES) foreach @checksum_fields; +&field_register($_, CTRL_PKG_SRC | CTRL_FILE_CHANGES | CTRL_FILE_BUILDINFO) foreach @checksum_fields; &field_register($_, CTRL_INDEX_PKG | CTRL_REPO_RELEASE, separator => FIELD_SEP_LINE | FIELD_SEP_SPACE) foreach @sum_fields; @@ -446,6 +468,13 @@ our %FIELD_ORDER = ( Vcs-Svn Testsuite Testsuite-Triggers), &field_list_src_dep(), qw(Package-List), @checksum_fields, qw(Files) ], + CTRL_FILE_BUILDINFO() => [ + qw(Format Source Binary Architecture Version + Binary-Only-Changes), + @checksum_fields, + qw(Build-Origin Build-Architecture Build-Path + Installed-Build-Depends Environment), + ], CTRL_FILE_CHANGES() => [ qw(Format Date Source Binary Binary-Only Built-For-Profiles Architecture Version Distribution Urgency Maintainer Changed-By Description diff --git a/scripts/Dpkg/Control/Types.pm b/scripts/Dpkg/Control/Types.pm index 1bb3e0ae4..445079d41 100644 --- a/scripts/Dpkg/Control/Types.pm +++ b/scripts/Dpkg/Control/Types.pm @@ -26,6 +26,7 @@ our @EXPORT = qw( CTRL_INDEX_PKG CTRL_PKG_SRC CTRL_PKG_DEB + CTRL_FILE_BUILDINFO CTRL_FILE_CHANGES CTRL_FILE_VENDOR CTRL_FILE_STATUS @@ -86,6 +87,8 @@ use constant { CTRL_COPYRIGHT_LICENSE => 8192, # Package test suite control file in debian/tests/control. CTRL_TESTS => 16384, + # .buildinfo file + CTRL_FILE_BUILDINFO => 32768, }; =head1 CHANGES |