Re: [PATCH v2 02/11] maint: don't leak developer GREP, SED etc into distribution file.

2010-09-23 Thread Gary V. Vaughan
typu ahead...

On 23 Sep 2010, at 22:21, Gary V. Vaughan wrote:
 I'm torn between running our
 own minimal substitution to fill the values in from libtool.m4, or
 having the make rule for libtool just edit them out.  Thoughts?

Of course, I mean the rule for ltmain.sh could edit them out
as it generates ltmain.sh.

Cheers,
-- 
Gary V. Vaughan (g...@gnu.org)


PGP.sig
Description: This is a digitally signed message part


Re: [PATCH v2 02/11] maint: don't leak developer GREP, SED etc into distribution file.

2010-09-23 Thread Ralf Wildenhues
Hello Gary,

* Gary V. Vaughan wrote on Thu, Sep 23, 2010 at 05:21:19PM CEST:
 I've pared this down to the absolute minimum necessary to fix the
 bug it is targetting.  I did run this through `make distcheck' (and
 it passed), but most of the others following only got a cursory
 `git clean -x -d -f  ./bootstrap  ./configure  ./make all
 check TESTS=tests/sh.test TESTSUITEFLAGS=1' unless noted otherwise.

Did you look at the output of the cursory check?  Like, after this
patch, I get this in the output:

  ##  ##
  ## @PACKAGE_STRING@ test suite. ##
  ##  ##

See below for an explanation.

  With this patch applied, the generated libtool script still contains
  the following lines:
  
  : ${EGREP=@EGREP@}
  : ${FGREP=@FGREP@}
  : ${GREP=@GREP@}
  : ${LN_S=@LN_S@}
  [...]
  : ${SED=@SED@}
  
  Now, the lines are all ineffective, because the tag variables (which
  will be expanded before these lines) will set all of these variables.
  Kind of ugly, but alright if you prefer to clean that up later.
 
 Oh!  I'd forgotten that AC_INIT_COMMANDS don't get run through the
 AC_SUBST machinery :(

Unfortunately, I cannot parse this statement.  What does
AC_INIT_COMMANDS have to do with these lines which come from
general.m4sh originally?

 I'd like to tackle that separately.  Unfortunately those settings
 come from general.m4sh boilerplate and are required by libtoolize, so
 it's not entirely straight forward.

Agreed.

 I'm torn between running our
 own minimal substitution to fill the values in from libtool.m4, or
 having the make rule for libtool just edit them out.  Thoughts?

Editing them out is fine.  Again, fixing this later is fine with me,
too.

 Okay to push this one now?

It is still not quite correct.  See below.

 * Makefile.am: Having rearranged the file, now apply the actual
 changes to follow-up.
 (edit): Split into two parts...
 (bootstrap_edit): ...substitutions that should happen at bootstrap
 time...
 (configure_edit): ...and substitutions that should not happen until
 configure time.
 * Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh)
 (libtoolize.in): Use bootstrap_edit.

This log line is not reflected in the patch contents.  And in fact, with
the patch applied, the generated libtoolize script still has
untransformed strings:

$ head libtoolize | sed 's/^/| '
| #! /bin/sh
| # Generated from libtoolize.m4sh by GNU Autoconf 2.68.
| 
| # libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
[...]

 (libtoolize, tests/package.m4): Use configure_edit.

For tests/package.m4, this is the wrong thing to do; see below.

 * HACKING (Release Procedure): Remove the note to workaround the
 bug fixed by this changeset.
 * NEWS (Bug fixes): Mention that this bug is now fixed.
 Reported by Joerg Sonnenberger.

 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -75,26 +75,23 @@ EXTRA_DIST += bootstrap $(srcdir)/libtoolize.in 
 $(auxdir)/ltmain.m4sh \
  CLEANFILES += libtool libtoolize libtoolize.tmp \
 $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp
  
 -edit = sed \
 - -e 's,@EGREP\@,$(EGREP),g' \
 - -e 's,@FGREP\@,$(FGREP),g' \
 - -e 's,@GREP\@,$(GREP),g' \
 - -e 's,@LN_S\@,$(LN_S),g' \
 - -e 's,@MACRO_VERSION\@,$(VERSION),g' \
 - -e 's,@PACKAGE\@,$(PACKAGE),g' \
 - -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
 - -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
 - -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
 - -e 's,@PACKAGE_STRING\@,$(PACKAGE_NAME) $(VERSION),g' \
 - -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
 - -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
 - -e 's,@SED\@,$(SED),g' \
 - -e 's,@VERSION\@,$(VERSION),g' \
 - -e 's,@aclocaldir\@,$(aclocaldir),g' \
 - -e 's,@datadir\@,$(datadir),g' \
 - -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
 - -e 's,@host_triplet\@,$(host_triplet),g' \
 - -e 's,@prefix\@,$(prefix),g'
 +## These are the replacements that need to be made at bootstrap time,
 +## because they must be static in distributed files, and not accidentally
 +## changed by configure running on the build machine.
 +bootstrap_edit  = sed \
 +   -e 's,@MACRO_VERSION\@,$(VERSION),g' \
 +   -e s,@MACRO_REVISION\@,$$correctver,g \
 +   -e s,@MACRO_SERIAL\@,$$serial,g \
 +   -e 's,@PACKAGE\@,$(PACKAGE),g' \
 +   -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
 +   -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
 +   -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
 +   -e s,@package_revision\@,$$correctver,g \
 +   -e 's,@PACKAGE_STRING\@,$(PACKAGE_NAME) $(VERSION),g' \
 +   -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
 +   -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
 +   -e s,@TIMESTAMP\@,$$TIMESTAMP,g \
 +   -e 's,@VERSION\@,$(VERSION),g'
  
  ## We build ltversion.m4 here, instead of from config.status,
  ## because config.status