summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r--scripts/Dpkg/Control.pm13
-rw-r--r--scripts/Dpkg/Control/FieldsCore.pm41
-rw-r--r--scripts/Dpkg/Control/Types.pm3
-rw-r--r--scripts/Dpkg/Vendor/Debian.pm2
-rw-r--r--scripts/Dpkg/Vendor/Default.pm12
5 files changed, 64 insertions, 7 deletions
diff --git a/scripts/Dpkg/Control.pm b/scripts/Dpkg/Control.pm
index e65891f3a..f41f250d5 100644
--- a/scripts/Dpkg/Control.pm
+++ b/scripts/Dpkg/Control.pm
@@ -18,7 +18,7 @@ package Dpkg::Control;
use strict;
use warnings;
-our $VERSION = '1.02';
+our $VERSION = '1.03';
our @EXPORT = qw(
CTRL_UNKNOWN
CTRL_INFO_SRC
@@ -28,6 +28,7 @@ our @EXPORT = qw(
CTRL_REPO_RELEASE
CTRL_PKG_SRC
CTRL_PKG_DEB
+ CTRL_FILE_BUILDINFO
CTRL_FILE_CHANGES
CTRL_FILE_VENDOR
CTRL_FILE_STATUS
@@ -104,6 +105,10 @@ Corresponds to a .dsc file of a Debian source package.
Corresponds to the F<control> file generated by dpkg-gencontrol
(F<DEBIAN/control>) and to the same file inside .deb packages.
+=item CTRL_FILE_BUILDINFO
+
+Corresponds to a .buildinfo file.
+
=item CTRL_FILE_CHANGES
Corresponds to a .changes file.
@@ -210,6 +215,8 @@ sub set_options {
$$self->{name} = sprintf(g_('%s file'), '.dsc');
} elsif ($t == CTRL_PKG_DEB) {
$$self->{name} = g_('control info of a .deb package');
+ } elsif ($t == CTRL_FILE_BUILDINFO) {
+ $$self->{name} = g_('build information file');
} elsif ($t == CTRL_FILE_CHANGES) {
$$self->{name} = sprintf(g_('%s file'), '.changes');
} elsif ($t == CTRL_FILE_VENDOR) {
@@ -240,6 +247,10 @@ sub get_type {
=head1 CHANGES
+=head2 Version 1.03 (dpkg 1.18.11)
+
+New type: CTRL_FILE_BUILDINFO.
+
=head2 Version 1.02 (dpkg 1.18.8)
New type: CTRL_TESTS.
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
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 560db2de8..bbba00d52 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -83,6 +83,8 @@ sub run_hook {
$self->_add_reproducible_flags(@params);
$self->_add_sanitize_flags(@params);
$self->_add_hardening_flags(@params);
+ } elsif ($hook eq 'builtin-system-build-paths') {
+ return qw(/build/);
} else {
return $self->SUPER::run_hook($hook, @params);
}
diff --git a/scripts/Dpkg/Vendor/Default.pm b/scripts/Dpkg/Vendor/Default.pm
index 9d53097f9..40815efde 100644
--- a/scripts/Dpkg/Vendor/Default.pm
+++ b/scripts/Dpkg/Vendor/Default.pm
@@ -130,6 +130,16 @@ The hook is called in Dpkg::BuildFlags to allow the vendor to override
the default values set for the various build flags. $flags is a
Dpkg::BuildFlags object.
+=item builtin-system-build-paths ()
+
+The hook is called by dpkg-genbuildinfo to determine if the current path
+should be recorded in the B<Build-Path> field (since dpkg 1.18.11). It takes
+no parameters, but returns a (possibly empty) list of root paths considered
+acceptable. As an example, if the list contains "/build/", a Build-Path
+field will be created if the current directory is "/build/dpkg-1.18.0". If
+the list contains "/", the path will always be recorded. If the list is
+empty, the current path will never be recorded.
+
=back
=cut
@@ -160,6 +170,8 @@ sub run_hook {
my ($textref, $ch_info) = @params;
} elsif ($hook eq 'update-buildflags') {
my $flags = shift @params;
+ } elsif ($hook eq 'builtin-system-build-paths') {
+ return ();
}
# Default return value for unknown/unimplemented hooks