[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patches] manual/Makefile: fix escaping of PKGVERSION and REPORT_BUGS_TO



On Wed, Oct 12, 2011 at 4:28 AM, Joseph S. Myers
<joseph@xxxxxxxxxxxxxxxx> wrote:
> On Mon, 10 Oct 2011, Michael Hope wrote:
>
>> crosstool-NG uses 'crosstool-NG @ mercurial-revno' as the default
>> package version.  This breaks the EGLIBC manuals as '@' starts a
>> Texinfo command.  Fix by escaping.
>>
>> I noticed that REPORT_BUGS_TO is broken as well, but in a different
>> way.  There's a sed that converts @ into the escaped @@ to allow email
>> style bug URLs, but it applies it to the command as well as the value.
>>
>> I've converted these to GNU make substitutions instead.  The change is EGLIBC
>> specific as GLIBC doesn't put the pkgversion in the manual.
>
> I see Maxim committed this, but I don't think it's the right approach.
> The autoconf macros used (shared with GCC, binutils etc.) define
> REPORT_BUGS_TEXI, and that's what should be used for the manual.

The attached version defines PKGVERSION_TEXI and uses the *_TEXI
versions in the manual.

-- Michael
Index: libc/config.make.in
===================================================================
--- libc/config.make.in	(revision 15508)
+++ libc/config.make.in	(working copy)
@@ -140,6 +140,8 @@
 
 # Package versions and bug reporting configuration.
 PKGVERSION = @PKGVERSION@
+PKGVERSION_TEXI = @PKGVERSION_TEXI@
 REPORT_BUGS_TO = @REPORT_BUGS_TO@
+REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
 
 # More variables may be inserted below by configure.
Index: libc/aclocal.m4
===================================================================
--- libc/aclocal.m4	(revision 15508)
+++ libc/aclocal.m4	(working copy)
@@ -131,7 +131,9 @@
      esac],
     PKGVERSION="($1) "
   )
+  PKGVERSION_TEXI=`echo "$PKGVERSION" | sed 's/@/@@/g'`
   AC_SUBST(PKGVERSION)
+  AC_SUBST(PKGVERSION_TEXI)
 ])
 
 dnl Support the --with-bugurl configure option.
Index: libc/manual/Makefile
===================================================================
--- libc/manual/Makefile	(revision 15508)
+++ libc/manual/Makefile	(working copy)
@@ -116,9 +116,8 @@
 # Package version and bug reporting URL.
 pkgvers.texi: stamp-pkgvers
 stamp-pkgvers:
-	echo "@set PKGVERSION $(subst @,@@,$(PKGVERSION))" > pkgvers-tmp
-	echo "@set REPORT_BUGS_TO $(subst @,@@,$(REPORT_BUGS_TO))" \
-	  >> pkgvers-tmp
+	echo "@set PKGVERSION $(PKGVERSION_TEXI)" > pkgvers-tmp
+	echo "@set REPORT_BUGS_TO $(REPORT_BUGS_TEXI)" >> pkgvers-tmp
 	$(move-if-change) pkgvers-tmp pkgvers.texi
 	touch $@
 
Index: libc/configure
===================================================================
--- libc/configure	(revision 15508)
+++ libc/configure	(working copy)
@@ -733,6 +733,7 @@
 libc_cv_nss_crypt
 REPORT_BUGS_TEXI
 REPORT_BUGS_TO
+PKGVERSION_TEXI
 PKGVERSION
 all_warnings
 force_install
@@ -3831,10 +3832,12 @@
 
 fi
 
+  PKGVERSION_TEXI=`echo "$PKGVERSION" | sed 's/@/@@/g'`
 
 
 
 
+
 # Check whether --with-bugurl was given.
 if test "${with_bugurl+set}" = set; then
   withval=$with_bugurl; case "$withval" in
Index: libc/ChangeLog.eglibc
===================================================================
--- libc/ChangeLog.eglibc	(revision 15508)
+++ libc/ChangeLog.eglibc	(working copy)
@@ -1,3 +1,11 @@
+2011-10-12  Michael Hope  <michael.hope@xxxxxxxxxx>
+
+	* aclocal.m4 (PKGVERSION_TEXI): Define.
+	* config.make.in (PKGVERSION_TEXI, REPORT_BUGS_TEXI): Define.
+	* manual/Makefile (stamp-pkgvers): Use PKGVERSION_TEXI and
+	REPORT_BUGS_TEXI.
+	* configure: Regenerate.
+
 2011-10-07  Michael Hope  <michael.hope@xxxxxxxxxx>
 
 	* manual/Makefile (stamp-pkgvers): Escape PKGVERSION.  Fix the