diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 16:37:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 16:37:29 +0000 |
commit | 02d0b2a8ef5a2dff3f22d29dee7800d9a5928e86 (patch) | |
tree | 879d7ae69586f509481289e50746748c098500b8 /lib/Debian/Debhelper/Dh_Lib.pm | |
parent | Adding upstream version 13.15.3. (diff) | |
download | debhelper-02d0b2a8ef5a2dff3f22d29dee7800d9a5928e86.tar.xz debhelper-02d0b2a8ef5a2dff3f22d29dee7800d9a5928e86.zip |
Adding upstream version 13.16.upstream/13.16
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/Debian/Debhelper/Dh_Lib.pm')
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index 720741f..cdc1686 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -248,6 +248,8 @@ our $DEB822_FIELD_REGEX = qr/ /xoa; our $PARSE_DH_SEQUENCE_INFO = 0; +# Safety valve for `dh_assistant`. Not intended for anyone else. +our $ALLOW_UNSAFE_EXECUTION = 1; # We need logging in compat 9 or in override/hook targets (for --remaining-packages to work) # - This option is a global toggle to disable logs for special commands (e.g. dh or dh_clean) @@ -970,7 +972,7 @@ my ($compat_from_bd, $compat_from_dctrl); $delared_compat_source = "Build-Depends: debhelper-compat (= $c)"; } elsif ($compat_from_dctrl != -1) { $c = $compat_from_dctrl; - $delared_compat_source = "X-DH-Comat: $c"; + $delared_compat_source = "X-DH-Compat: $c"; } elsif (not $nowarn) { # d/compat deliberately omitted since we do not want to recommend users to it. error("Please specify the compatibility level in debian/control. Such as, via Build-Depends: debhelper-compat (= X)"); @@ -1121,8 +1123,15 @@ sub default_sourcedir { ); } push(@try, "debian/$package.$filename"); + my $nameless_variant = "debian/$filename"; + if (defined $dh{NAME} and not compat(13) and -f $nameless_variant) { + warning('The use of prefix-less debhelper config files with --name is deprecated.'); + warning("Please rename \"${nameless_variant}\" to \"debian/$dh{MAINPACKAGE}.${filename}\""); + error("Named prefix-less debhelper config files is not supported in compat 15 and later") + if not compat(14); + warning('Named prefix-less debhelper config files will trigger an error in compat 15 or later'); + } if ($nameless_variant_handling or (not defined($nameless_variant_handling) and $package eq $dh{MAINPACKAGE})) { - my $nameless_variant = "debian/$filename"; push(@try, $nameless_variant); if (getpackages() > 1 and not $nameless_variant_handling and not compat(13) and -f $nameless_variant) { warning('The use of prefix-less debhelper config files is deprecated.'); @@ -3286,4 +3295,10 @@ sub _internal_optional_file_args { return; } +sub assert_unsafe_execution_is_ok { + if (not $Debian::Debhelper::Dh_Lib::ALLOW_UNSAFE_EXECUTION) { + error("Internal error: The command did not want to allow unsafe execution, but was about to trigger it!"); + } +} + 1 |