diff options
author | Guillem Jover <guillem@debian.org> | 2017-10-28 12:56:42 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2018-01-16 11:26:38 +0100 |
commit | 585db35d2356193e679dff3eb73d99e65c575f7b (patch) | |
tree | fce7e9d4aa517f5685fef81d4b20a9afbd4fa312 /scripts | |
parent | 566a4b61b6c3359c3d4cffa05519ecbc967b292c (diff) | |
download | dpkg-585db35d2356193e679dff3eb73d99e65c575f7b.tar.gz |
dpkg-buildpackage: Add new --rules-requires-root
This new option makes it possible to force falling back to the legacy
behavior of assuming that debian/rules files require root.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dpkg-buildpackage.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index bd0a6f6a6..49c7173a4 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -80,6 +80,7 @@ sub usage { do not check builtin build dependencies. -P, --build-profiles=<profiles> assume comma-separated build profiles as active. + --rules-requires-root assume legacy Rules-Requires-Root field value. -R, --rules-file=<rules> rules file to execute (default is debian/rules). -T, --rules-target=<target> call debian/rules <target>. --as-root ensure -T calls the target with root rights. @@ -169,6 +170,7 @@ my $host_type = ''; my $target_arch = ''; my $target_type = ''; my @build_profiles = (); +my $rrr_override; my @call_target = (); my $call_target_as_root = 0; my $since; @@ -309,6 +311,8 @@ while (@ARGV) { } elsif (/^(?:--target=|--rules-target=|-T)(.+)$/) { my $arg = $1; push @call_target, split /,/, $arg; + } elsif (/^--rules-requires-root$/) { + $rrr_override = 'binary-targets'; } elsif (/^--as-root$/) { $call_target_as_root = 1; } elsif (/^--pre-clean$/) { @@ -683,10 +687,12 @@ sub parse_rules_requires_root { my $ctrl = shift; my %rrr; - my $rrr = $ctrl->{'Rules-Requires-Root'} // 'binary-targets'; + my $rrr; my $keywords_base; my $keywords_impl; + $rrr = $rrr_override // $ctrl->{'Rules-Requires-Root'} // 'binary-targets'; + foreach my $keyword (split ' ', $rrr) { if ($keyword =~ m{/}) { if ($keyword =~ m{^dpkg/target/(.*)$}p and $target_official{$1}) { |