Bug#732797: PKG_CHECK_MODULES should report the module name, not variable prefix

2016-10-19 Thread Guillem Jover
Control: forwarded -1 https://bugs.freedesktop.org/show_bug.cgi?id=98334

Hi!

On Wed, 2016-10-19 at 12:28:55 -0700, Russ Allbery wrote:
> Guillem Jover  writes:
> > I noticed this bug report some time ago, but I've got bothered enough
> > now to try to move it forward. And I've turned the above description
> > and the below "patch"…
> 
> [...]
> 
> > …into a git formatted patch (against current master). But because
> > I've actually reworded things a bit, and I feel like I've actually put
> > words in Russ' mouth, I'd rather you'd take a look before considering
> > forwarding it upstream! I'll also very happily defer if you'd want to
> > do that yourself!
> 
> Thanks for doing this!  As the other bug reporter, very happy to have you
> forward this upstream.  I haven't had a lot of time recently to chase
> things like this, and have a huge backlog, so happy to encourage others to
> push such things forward.  Everything in the patch looked good to me.

Perfect thanks! I've now submitted it upstream, let' see what they
say. :)

Regards,
Guillem



Bug#732797: PKG_CHECK_MODULES should report the module name, not variable prefix

2016-10-19 Thread Russ Allbery
Guillem Jover  writes:

> I noticed this bug report some time ago, but I've got bothered enough
> now to try to move it forward. And I've turned the above description
> and the below "patch"…

[...]

> …into a git formatted patch (against current master). But because
> I've actually reworded things a bit, and I feel like I've actually put
> words in Russ' mouth, I'd rather you'd take a look before considering
> forwarding it upstream! I'll also very happily defer if you'd want to
> do that yourself!

Thanks for doing this!  As the other bug reporter, very happy to have you
forward this upstream.  I haven't had a lot of time recently to chase
things like this, and have a huge backlog, so happy to encourage others to
push such things forward.  Everything in the patch looked good to me.

-- 
Russ Allbery (r...@debian.org)   



Bug#732797: PKG_CHECK_MODULES should report the module name, not variable prefix

2016-09-22 Thread Guillem Jover
Control: tags -1 patch

On Sat, 2013-12-21 at 12:24:49 -0800, Russ Allbery wrote:
> Package: pkg-config
> Version: 0.26-1
> Severity: minor

> In Autoconf output from PKG_CHECK_MODULES in pkg.m4, the "checking for"
> message refers to the first argument of PKG_CHECK_MODULES, the variable
> prefix, instead of the second argument, the module being checked for.
> 
> I've seen this result in strange output (like ALL CAPS module names) in
> various packages, and now have run into it in one of mine.  When
> probing for the libsystemd-daemon module, one can't use a variable
> prefix that matches the module name (since - isn't allowed in variable
> names), so the Autoconf output is going to refer to something odd, like
> SYSTEMD_DAEMON or libsystemd_daemon.
> 
> I think the status output should reference the module name being
> probed for, both because it looks nicer and because, when debugging
> problems, this references the actual thing being probed for on the
> system, rather than an internal implementation detail.

I agree wholeheartedly! I guess one possible objection is that this is
not that internal, as that name is also used by the AC_ARG_VARs so
that the user can override the values, but still, this does not match
with other checks such as the compiler which prints the actual program
instead of CC.

I noticed this bug report some time ago, but I've got bothered enough
now to try to move it forward. And I've turned the above description
and the below "patch"…

> This could be easily done by changing the line:
> 
> AC_MSG_CHECKING([for $1])
> 
> in pkg.m4 to:
> 
> AC_MSG_CHECKING([for $2])

…into a git formatted patch (against current master). But because
I've actually reworded things a bit, and I feel like I've actually put
words in Russ' mouth, I'd rather you'd take a look before considering
forwarding it upstream! I'll also very happily defer if you'd want to
do that yourself!

Patch attached.

Thanks,
Guillem
From fcdcf0d60ea52a4cfd636046e049c11cdc4497a9 Mon Sep 17 00:00:00 2001
From: Russ Allbery 
Date: Thu, 22 Sep 2016 23:44:02 +0200
Subject: [PATCH] Make PKG_CHECK_MODULES report the module name instead of the
 variable prefix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In Autoconf output from PKG_CHECK_MODULES in pkg.m4, the "checking for"
message refers to the first argument of PKG_CHECK_MODULES, the variable
prefix, instead of the second argument, the module being checked for.

This results in strange output (like ALL CAPS module names) in various
packages. And when probing for modules, one can't always use a variable
prefix that matches the module name (since ‘-’ and other characters
aren't allowed in variable names), so the Autoconf output is going to
refer to something odd.

The status output should reference the module name being probed for,
both because it looks nicer and because, when debugging problems, this
references the actual thing being probed for on the system, rather than
an internal implementation detail.

Signed-off-by: Guillem Jover 
---
 pkg.m4.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg.m4.in b/pkg.m4.in
index eb44361..2b341dd 100644
--- a/pkg.m4.in
+++ b/pkg.m4.in
@@ -142,7 +142,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
 pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
 
 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
-- 
2.9.3



Bug#732797: PKG_CHECK_MODULES should report the module name, not variable prefix

2013-12-21 Thread Russ Allbery
Package: pkg-config
Version: 0.26-1
Severity: minor

In Autoconf output from PKG_CHECK_MODULES in pkg.m4, the "checking for"
message refers to the first argument of PKG_CHECK_MODULES, the variable
prefix, instead of the second argument, the module being checked for.

I've seen this result in strange output (like ALL CAPS module names) in
various packages, and now have run into it in one of mine.  When
probing for the libsystemd-daemon module, one can't use a variable
prefix that matches the module name (since - isn't allowed in variable
names), so the Autoconf output is going to refer to something odd, like
SYSTEMD_DAEMON or libsystemd_daemon.

I think the status output should reference the module name being
probed for, both because it looks nicer and because, when debugging
problems, this references the actual thing being probed for on the
system, rather than an internal implementation detail.

This could be easily done by changing the line:

AC_MSG_CHECKING([for $1])

in pkg.m4 to:

AC_MSG_CHECKING([for $2])

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.11-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pkg-config depends on:
ii  libc6 2.17-97
ii  libglib2.0-0  2.36.4-1
ii  libpopt0  1.16-8

pkg-config recommends no packages.

pkg-config suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org