Bug#299140: [PATCH] intltool-update: FindPackageName: wrong shell
variable names for PACKAGE_NAME
Peter Moulder
Peter Moulder <pmoulder@bowman.csse.monash.edu.au>,
299140@bugs.debian.org
Sat, 12 Mar 2005 12:06:20 +1100
Package: intltool
Version: 0.33-1
Severity: normal
If a package's configure.ac file has
GETTEXT_PACKAGE="$PACKAGE_NAME"
then FindPackageName fails to expand it.
AC_INIT(mypackage, myversion) defines AC_PACKAGE_NAME m4 macro and
PACKAGE_NAME shell variable (AC_SUBST). Whereas FindPackageName was
assuming that the shell variable was also called $AC_PACKAGE_NAME.
The appended patch is intended to address this problem.
N.B. I haven't tested this patch, as I don't know fully how to reproduce
the original problem; it was reported to me by a user of some software I
help to maintain. I'm sending this patch now just to make sure I don't
forget about it. If I see the user again then I'll ask them about it.
pjrm.
diff -dur intltool-0.33/intltool-update.in.in intltool-0.33-pjrm/intltool-update.in.in
--- intltool-0.33/intltool-update.in.in 2005-01-24 11:48:34.000000000 +1100
+++ intltool-0.33-pjrm/intltool-update.in.in 2005-03-12 11:40:09.947127608 +1100
@@ -989,9 +989,9 @@
($name, $version) = ($1, $2);
$name =~ s/[\[\]\s]//g;
$version =~ s/[\[\]\s]//g;
- $varhash{"AC_PACKAGE_NAME"} = $name;
+ $varhash{"PACKAGE_NAME"} = $name;
$varhash{"PACKAGE"} = $name;
- $varhash{"AC_PACKAGE_VERSION"} = $version;
+ $varhash{"PACKAGE_VERSION"} = $version;
$varhash{"VERSION"} = $version;
}
@@ -1000,19 +1000,18 @@
($name, $version) = ($1, $2);
$name =~ s/[\[\]\s]//g;
$version =~ s/[\[\]\s]//g;
- $varhash{"AC_PACKAGE_NAME"} = $name;
+ $varhash{"PACKAGE_NAME"} = $name;
$varhash{"PACKAGE"} = $name;
- $varhash{"AC_PACKAGE_VERSION"} = $version;
+ $varhash{"PACKAGE_VERSION"} = $version;
$varhash{"VERSION"} = $version;
}
# \s makes this not work, why?
$name = $1 if $conf_source =~ /^GETTEXT_PACKAGE=\[?([^\n\]]+)/m;
- # prepend '$' to auto* internal variables, usually they are
- # used in configure.in/ac without the '$'
- $name =~ s/AC_/\$AC_/g;
- $name =~ s/\$\$/\$/g;
+ # m4 macros AC_PACKAGE_NAME, AC_PACKAGE_VERSION etc. have same value
+ # as corresponding $PACKAGE_NAME, $PACKAGE_VERSION etc. shell variables.
+ $name =~ s/\bAC_PACKAGE_/\$PACKAGE_/g;
$name = $domain if $domain;