From 844f9dee1c256e13b61cc38cba7b21f257e3103f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 17 Jun 2024 18:37:29 +0200 Subject: Merging upstream version 13.16. Signed-off-by: Daniel Baumann --- lib/Debian/Debhelper/Dh_Lib.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lib/Debian/Debhelper/Dh_Lib.pm') 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 -- cgit v1.2.3