diff options
author | Niels Thykier <niels@thykier.net> | 2019-08-18 18:38:33 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2019-08-18 18:38:33 +0000 |
commit | e1d4bccac05c9c8d245cd74308a404c7ff59d0b9 (patch) | |
tree | 8edf32973c518b464b3cf673a4968ebbe96f3a5a | |
parent | 024b390510b7237edaa0b88c2492d3e9d93503b4 (diff) | |
download | debhelper-e1d4bccac05c9c8d245cd74308a404c7ff59d0b9.tar.gz |
Avoid parsing d/control before handling --help/--list
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r-- | debian/changelog | 13 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Dh_Getopt.pm | 2 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 7 |
3 files changed, 18 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 6a5c1c46..0ee55e2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (12.5.3) UNRELEASED; urgency=medium + + * Dh_Getopt.pm: Skip compat call if d/control cannot be found + and just assume that auto-abbreviation can be disabled in that + case. This avoids breaking options such as --help and --list. + (Closes: #935017) + * Dh_Lib.pm: Jump to hoops to only parse the Build-Dependency + field in dh without breaking dh's own --list or --help + parameter. This fixes a regression since 12.5 where dh's + --help and --list options were broken. + + -- Niels Thykier <niels@thykier.net> Sun, 18 Aug 2019 18:33:50 +0000 + debhelper (12.5.2) unstable; urgency=medium * dh_makeshlibs: Fix regression in compat 10 and earlier where diff --git a/lib/Debian/Debhelper/Dh_Getopt.pm b/lib/Debian/Debhelper/Dh_Getopt.pm index 591f0e22..0f3fb781 100644 --- a/lib/Debian/Debhelper/Dh_Getopt.pm +++ b/lib/Debian/Debhelper/Dh_Getopt.pm @@ -95,7 +95,7 @@ sub getoptions { Getopt::Long::config("bundling"); } Getopt::Long::config('no_ignore_case'); - if (! compat(12, 1)) { + if ( ! -f 'debian/control' or ! compat(12, 1)) { Getopt::Long::config('no_auto_abbrev'); } diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index 7a55e22f..47cca1fb 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -199,11 +199,13 @@ our $DEB822_FIELD_REGEX = qr/ [\x21-\x39\x3B-\x7F]* # Subsequent characters (if any) /xoa; +our $PARSE_DH_SEQUENCE_INFO = 0; + sub init { my %params=@_; if ($params{internal_parse_dh_sequence_info}) { - _parse_debian_control(1); + $PARSE_DH_SEQUENCE_INFO = 1; } # Check if we can by-pass the expensive Getopt::Long by optimising for the @@ -1587,7 +1589,6 @@ sub getpackages { } sub _parse_debian_control { - my ($parse_dh_sequence_info) = @_; my $package=""; my $arch=""; my $section=""; @@ -1699,7 +1700,7 @@ sub _parse_debian_control { error("Could not parse desired debhelper compat level from relation: $dep"); } # Build-Depends on dh-sequence-<foo> OR dh-sequence-<foo> (<op> <version>) - if ($parse_dh_sequence_info and $dep =~ m/^dh-sequence-(${PKGNAME_REGEX})\s*(?:[(]\s*(?:[<>]?=|<<|>>)\s*(?:${PKGVERSION_REGEX})\s*[)])?(\s*[^\|]+[]>]\s*)?$/) { + if ($PARSE_DH_SEQUENCE_INFO and $dep =~ m/^dh-sequence-(${PKGNAME_REGEX})\s*(?:[(]\s*(?:[<>]?=|<<|>>)\s*(?:${PKGVERSION_REGEX})\s*[)])?(\s*[^\|]+[]>]\s*)?$/) { my $sequence = $1; my $has_profile_or_arch_restriction = $2 ? 1 : 0; my $addon_type = $field2addon_type{$field}; |