Your message dated Sun, 15 Jan 2023 20:57:49 +0100
with message-id <[email protected]>
and subject line Re: Bug#1028963: Dh_Lib: qx_cmd does not support shell features
has caused the Debian Bug report #1028963,
regarding Dh_Lib: qx_cmd does not support shell features
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1028963: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028963
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: debhelper
Version: 13.11.1
Hello!
The fix of https://bugs.debian.org/1016354 resulted in a regression so
Ubuntu's debhelper extension dh-translations stopped working.
This is the commit:
https://salsa.debian.org/debian/debhelper/-/commit/62a8608e
The qx_cmd() function has been used conveniently in dh_translations to
grab the output from a few commands which make use of pipes. Now that
doesn't work any longer. It was resolved for now by copying the qx_cmd()
function as it looked like before commit 62a8608e into dh_translations.
Please see the attached diff.
This raises the question if there is a need also for a 'cleaner' qx_cmd
function. Maybe "complex_qx_cmd" (compare complex_doit).
--
Cheers,
Gunnar Hjalmarsson
--- /usr/bin/dh_translations.orig 2019-02-05 16:05:37.000000000 +0100
+++ /usr/bin/dh_translations 2023-01-14 09:15:08.190676370 +0100
@@ -55,6 +55,26 @@
my ($domain, $use_intltool, $meson_builddir);
+# This is the version of the qx_cmd() function in Dh_Lib.pm before
+# https://salsa.debian.org/debian/debhelper/-/commit/62a8608
+sub qx_meson_cmd {
+ my (@cmd) = @_;
+ my ($output, @output);
+ open(my $fd, '-|', @cmd) or error('fork+exec (' . escape_shell(@cmd) . "): $!");
+ if (wantarray) {
+ @output = <$fd>;
+ } else {
+ local $/ = undef;
+ $output = <$fd>;
+ }
+ if (not close($fd)) {
+ error("close pipe failed: $!") if $!;
+ error_exitcode(escape_shell(@cmd));
+ }
+ return @output if wantarray;
+ return $output;
+}
+
# figure out intltool usage and domain
sub check_buildsystem {
$use_intltool = 0;
@@ -88,7 +108,7 @@
$meson_builddir = File::Spec->rel2abs($dirs[0]);
- my $all_domains = qx_cmd ("meson introspect '$meson_builddir' --targets | jq -r -M '.[].name | select(endswith(\"-pot\")) | sub(\"-pot\"; \"\")'");
+ my $all_domains = qx_meson_cmd ("meson introspect '$meson_builddir' --targets | jq -r -M '.[].name | select(endswith(\"-pot\")) | sub(\"-pot\"; \"\")'");
my @domains = split (' ', $all_domains);
@@ -101,10 +121,10 @@
} else {
# meson 0.49 changed the property name from 'name' to 'descriptive_name'
# prevent confusion due to possible help-* domain
- my $project = qx_cmd ("meson introspect '$meson_builddir' --projectinfo | jq -r '.descriptive_name'");
+ my $project = qx_meson_cmd ("meson introspect '$meson_builddir' --projectinfo | jq -r '.descriptive_name'");
chomp $project;
if ($project eq "null") {
- $project = qx_cmd ("meson introspect '$meson_builddir' --projectinfo | jq -r '.name'");
+ $project = qx_meson_cmd ("meson introspect '$meson_builddir' --projectinfo | jq -r '.name'");
chomp $project;
}
@domains = grep { $_ ne 'help-'.$project } @domains;
--- End Message ---
--- Begin Message ---
Well, Niels, changing the title of this bug does not change the fact
that it was a surprise change of the qx_cmd behavior.
Niels Thykier wrote:
If you want a shell, you can just use perl's qx operator
Actually I tried to just replace qx_cmd with qx, but failed to make it
work. Now I made a new attempt, and yes, if dealing with quotes a bit
differently, using qx() seems to work as well. So indeed, a
supplementary function is apparently not needed. I agree with "wontfix"
and close this bug.
Maybe we'll make that change to dh_translations later. For now we'll
keep "abusing" the old qx_cmd function if you don't mind. ;)
--
Thank you,
Gunnar
--- End Message ---