summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2019-07-30 04:45:57 +0200
committerGuillem Jover <guillem@debian.org>2019-10-30 22:02:43 +0100
commit36925e06749e495a475f6c42543b226d3f7ae27b (patch)
treedbab3f1f7f7efe955657d593824bac60ff980562
parent0e1709f6f4002a87bff1b0caa495ded77dd38d1f (diff)
downloaddpkg-36925e06749e495a475f6c42543b226d3f7ae27b.tar.gz
Dpkg::BuildFlags: Add new unset() method
This makes it possible to unset variables, so that they do not get output by the various tools. Requested-by: Daniel Schepler <dschepler@gmail.com>
-rw-r--r--debian/changelog2
-rw-r--r--scripts/Dpkg/BuildFlags.pm20
2 files changed, 21 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index ada26a5a2..a18c3b892 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,8 @@ dpkg (1.20.0) UNRELEASED; urgency=medium
never the correct solution.
* Perl modules:
- Dpkg::Source::Package: Verify original tarball signatures at build time.
+ - Dpkg::BuildFlags: Add new unset() method.
+ Requested by Daniel Schepler <dschepler@gmail.com>.
* Documentation:
- man: Fix uncommon wording constructs.
- man: Use a minus sign for a literal string.
diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm
index 906527b23..edf16e4f3 100644
--- a/scripts/Dpkg/BuildFlags.pm
+++ b/scripts/Dpkg/BuildFlags.pm
@@ -18,7 +18,7 @@ package Dpkg::BuildFlags;
use strict;
use warnings;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
use Dpkg ();
use Dpkg::Gettext;
@@ -212,6 +212,20 @@ sub load_config {
$self->load_maintainer_config();
}
+=item $bf->unset($flag)
+
+Unset the build flag $flag, so that it will not be known anymore.
+
+=cut
+
+sub unset {
+ my ($self, $flag) = @_;
+
+ delete $self->{flags}->{$flag};
+ delete $self->{origin}->{$flag};
+ delete $self->{maintainer}->{$flag};
+}
+
=item $bf->set($flag, $value, $source, $maint)
Update the build flag $flag with value $value and record its origin as
@@ -440,6 +454,10 @@ sub list {
=head1 CHANGES
+=head2 Version 1.04 (dpkg 1.20.0)
+
+New method: $bf->unset().
+
=head2 Version 1.03 (dpkg 1.16.5)
New method: $bf->get_feature_areas() to list possible values for