summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Dpkg/Control/FieldsCore.pm8
-rw-r--r--scripts/Dpkg/Substvars.pm26
-rwxr-xr-xscripts/dpkg-genchanges.pl4
-rwxr-xr-xscripts/dpkg-gencontrol.pl4
-rwxr-xr-xscripts/dpkg-source.pl2
-rw-r--r--scripts/t/Dpkg_Control_Fields.t13
6 files changed, 45 insertions, 12 deletions
diff --git a/scripts/Dpkg/Control/FieldsCore.pm b/scripts/Dpkg/Control/FieldsCore.pm
index 74c54e686..b100366e1 100644
--- a/scripts/Dpkg/Control/FieldsCore.pm
+++ b/scripts/Dpkg/Control/FieldsCore.pm
@@ -268,7 +268,7 @@ our %FIELDS = (
},
'description' => {
name => 'Description',
- allowed => ALL_PKG | CTRL_FILE_CHANGES | CTRL_REPO_RELEASE,
+ allowed => ALL_SRC | ALL_PKG | CTRL_FILE_CHANGES | CTRL_REPO_RELEASE,
},
'disclaimer' => {
name => 'Disclaimer',
@@ -618,14 +618,14 @@ our %FIELD_ORDER = (
],
CTRL_PKG_SRC() => [
qw(format source binary architecture version origin maintainer
- uploaders homepage standards-version vcs-browser
+ uploaders homepage description standards-version vcs-browser
vcs-arch vcs-bzr vcs-cvs vcs-darcs vcs-git vcs-hg vcs-mtn
vcs-svn testsuite testsuite-triggers), @src_dep_fields,
qw(package-list), @src_checksums_fields, qw(files)
],
CTRL_INDEX_SRC() => [
- qw(format package binary architecture version priority section
- origin maintainer uploaders homepage standards-version vcs-browser
+ qw(format package binary architecture version priority section origin
+ maintainer uploaders homepage description standards-version vcs-browser
vcs-arch vcs-bzr vcs-cvs vcs-darcs vcs-git vcs-hg vcs-mtn vcs-svn
testsuite testsuite-triggers), @src_dep_fields,
qw(package-list directory), @src_checksums_fields, qw(files)
diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm
index 920d1613c..1e9f90173 100644
--- a/scripts/Dpkg/Substvars.pm
+++ b/scripts/Dpkg/Substvars.pm
@@ -19,7 +19,7 @@ package Dpkg::Substvars;
use strict;
use warnings;
-our $VERSION = '1.05';
+our $VERSION = '1.06';
use Dpkg ();
use Dpkg::Arch qw(get_host_arch);
@@ -268,6 +268,26 @@ sub set_arch_substvars {
$self->set('Arch', get_host_arch(), $attr);
}
+=item $s->set_desc_substvars()
+
+Defines source description variables: ${source:Synopsis} and
+${source:Extended-Description}.
+
+These will never be warned about when unused.
+
+=cut
+
+sub set_desc_substvars {
+ my ($self, $desc) = @_;
+
+ my ($synopsis, $extended) = split /\n/, $desc, 2;
+
+ my $attr = SUBSTVAR_ATTR_USED | SUBSTVAR_ATTR_AUTO;
+
+ $self->set('source:Synopsis', $synopsis, $attr);
+ $self->set('source:Extended-Description', $extended, $attr);
+}
+
=item $s->set_field_substvars($ctrl, $prefix)
Defines field variables from a Dpkg::Control object, with each variable
@@ -417,6 +437,10 @@ sub output {
=head1 CHANGES
+=head2 Version 1.06 (dpkg 1.19.0)
+
+New method: $s->set_desc_substvars().
+
=head2 Version 1.05 (dpkg 1.18.11)
Obsolete substvar: Emit an error on Source-Version substvar usage.
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 8d56bbdf0..84bdc4ba6 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -233,6 +233,10 @@ foreach (keys %{$src_fields}) {
set_source_package($v);
} elsif (m/^Section$|^Priority$/i) {
$sourcedefault{$_} = $v;
+ } elsif (m/^Description$/i) {
+ # Description in changes is computed, do not copy this field, only
+ # initialize the description substvars.
+ $substvars->set_desc_substvars($v);
} else {
field_transfer_single($src_fields, $fields);
}
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index 98c304a25..2e656a246 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -196,6 +196,10 @@ my $src_fields = $control->get_source();
foreach (keys %{$src_fields}) {
if (m/^Source$/) {
set_source_package($src_fields->{$_});
+ } elsif (m/^Description$/) {
+ # Description in binary packages is not inherited, do not copy this
+ # field, only initialize the description substvars.
+ $substvars->set_desc_substvars($src_fields->{$_});
} else {
field_transfer_single($src_fields, $fields);
}
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index a4316fbb3..5c356c31a 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -332,7 +332,7 @@ if ($options{opmode} =~ /^(build|print-format|(before|after)-build|commit)$/) {
push(@sourcearch, $a) unless $archadded{$a}++;
}
}
- } elsif (m/^Homepage$/) {
+ } elsif (m/^(?:Homepage|Description)$/) {
# Do not overwrite the same field from the source entry
} else {
field_transfer_single($pkg, $fields);
diff --git a/scripts/t/Dpkg_Control_Fields.t b/scripts/t/Dpkg_Control_Fields.t
index e096c5494..7a6582287 100644
--- a/scripts/t/Dpkg_Control_Fields.t
+++ b/scripts/t/Dpkg_Control_Fields.t
@@ -57,9 +57,9 @@ my %fields = (
name => 'debian/control source stanza',
unordered => 1,
fields => [
- qw(Bugs Homepage Origin Maintainer Priority Section Source
- Standards-Version), @test_fields, qw(Uploaders),
- @vcs_fields, @src_dep_fields
+ qw(Bugs Homepage Description Origin Maintainer Uploaders
+ Priority Section Source Standards-Version),
+ @test_fields, @vcs_fields, @src_dep_fields
],
},
CTRL_INFO_PKG() => {
@@ -76,8 +76,8 @@ my %fields = (
CTRL_PKG_SRC() => {
name => '.dsc',
fields => [
- qw(Format Source Binary Architecture Version
- Origin Maintainer Uploaders Homepage Standards-Version),
+ qw(Format Source Binary Architecture Version Origin Maintainer
+ Uploaders Homepage Description Standards-Version),
@vcs_fields, @test_fields, @src_dep_fields,
qw(Package-List),
@src_files
@@ -98,7 +98,8 @@ my %fields = (
name => 'Sources',
fields => [
qw(Format Package Binary Architecture Version Priority Section
- Origin Maintainer Uploaders Homepage Standards-Version),
+ Origin Maintainer Uploaders Homepage Description
+ Standards-Version),
@vcs_fields, @test_fields, @src_dep_fields,
qw(Package-List Directory),
@src_files