libtool-patches
[Top][All Lists]
Advanced

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

[PATCH v2 02/11] maint: don't leak developer GREP, SED etc into distribu


From: Gary V. Vaughan
Subject: [PATCH v2 02/11] maint: don't leak developer GREP, SED etc into distribution file.
Date: Thu, 23 Sep 2010 22:21:19 +0700

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.

> 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 :(

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.  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?

Okay to push this one now?

* 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.
(libtoolize, tests/package.m4): Use configure_edit.
* 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.
---
 ChangeLog   |   16 ++++++++++++
 HACKING     |    9 -------
 Makefile.am |   74 +++++++++++++++++++++++++++++++----------------------------
 NEWS        |    2 +
 4 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 818229f..d9f5cbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2010-08-31  Gary V. Vaughan  <address@hidden>
 
+       maint: don't leak developer GREP, SED etc into distribution file.
+       * 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.
+       (libtoolize, tests/package.m4): Use configure_edit.
+       * 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.
+
        maint: rearrange Makefile.am in preparation for a follow-up patch.
        * Makefile.am (Libtool scripts.): Move this section below the
        `Bootstrap.' section...
diff --git a/HACKING b/HACKING
index 977be10..b17de29 100644
--- a/HACKING
+++ b/HACKING
@@ -619,15 +619,6 @@ or obtained by writing to the Free Software Foundation, 
Inc.,
 
 * Update NEWS, ChangeLog.
 
-* Until the bug that leaks developer tool paths into the release tarballs
-  from ./bootstrap is fixed, make sure the right tools are first in your
-  PATH and then:
-       export EGREP=egrep
-       export FGREP=fgrep
-       export GREP=grep
-       export MAKE=make
-       export SED=sed
-
 * Run ./bootstrap.
 
 * Run ./configure (or create a build directory first and run configure
diff --git a/Makefile.am b/Makefile.am
index dcb6d0d..89189f1 100644
--- 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 is rerun each time one of configure's
@@ -121,11 +118,9 @@ $(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in 
configure.ac ChangeLog
          cd $(srcdir); \
          rm -f $(m4dir)/ltversion.tmp; \
          serial=`echo "$$correctver" | sed 's,^1[.],,g'`; \
-         echo $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \
-           -e "s,@MACRO_SERIAL\@,$$serial,g" \
+         echo $(bootstrap_edit) \
            $(srcdir)/$(m4dir)/ltversion.in \> $(srcdir)/$(m4dir)/ltversion.m4; 
\
-         $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \
-                 -e "s,@MACRO_SERIAL\@,$$serial,g" \
+         $(bootstrap_edit) \
                  $(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \
          chmod a-w $(m4dir)/ltversion.tmp; \
          mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4; \
@@ -160,11 +155,9 @@ $(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) 
$(auxdir)/ltmain.m4sh configure.ac Ch
            \> $(auxdir)/ltmain.in; \
          $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
            > $(auxdir)/ltmain.in; \
-         echo $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
-           -e "s,@package_revision\@,$$correctver," \
+         echo $(bootstrap_edit) \
            $(srcdir)/$(auxdir)/ltmain.in "> $$target"; \
-         $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
-               -e "s,@package_revision\@,$$1,g" \
+         $(bootstrap_edit) \
                $(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \
          rm -f $(auxdir)/ltmain.in; \
          chmod a-w $(auxdir)/ltmain.tmp; \
@@ -220,16 +213,27 @@ all-local: $(LTDL_BOOTSTRAP_DEPS)
 ## Libtool scripts. ##
 ## ---------------- ##
 
+configure_edit = sed \
+       -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \
+       -e 's,@aclocaldir\@,$(aclocaldir),g' \
+       -e 's,@datadir\@,$(datadir),g' \
+       -e 's,@EGREP\@,$(EGREP),g' \
+       -e 's,@FGREP\@,$(FGREP),g' \
+       -e 's,@GREP\@,$(GREP),g' \
+       -e 's,@host_triplet\@,$(host_triplet),g' \
+       -e 's,@LN_S\@,$(LN_S),g' \
+       -e "s,@pkgconfig_files\@,$(auxfiles),g" \
+       -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
+       -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \
+       -e 's,@prefix\@,$(prefix),g' \
+       -e 's,@SED\@,$(SED),g'
+
 # The libtool distributor and the standalone libtool script.
 bin_SCRIPTS = libtoolize libtool
 
 libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
        rm -f libtoolize.tmp libtoolize
-       $(timestamp); \
-       $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
-               -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \
-               -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \
-               -e "s,@pkgconfig_files\@,$(auxfiles),g" \
+       $(configure_edit) \
                $(srcdir)/libtoolize.in > libtoolize.tmp
        chmod a+x libtoolize.tmp
        chmod a-w libtoolize.tmp
@@ -552,7 +556,7 @@ $(srcdir)/tests/package.m4: $(srcdir)/configure.ac 
Makefile.am
          echo 'm4_define([AT_PACKAGE_STRING],    address@hidden@])'; \
          echo 'm4_define([AT_PACKAGE_BUGREPORT], address@hidden@])'; \
          echo 'm4_define([AT_PACKAGE_URL],       address@hidden@])'; \
-       } | $(edit) > $(srcdir)/tests/package.m4
+       } | $(configure_edit) > $(srcdir)/tests/package.m4
 
 tests/atconfig: $(top_builddir)/config.status
        $(SHELL) ./config.status tests/atconfig
@@ -897,7 +901,7 @@ DIST_SUBDIRS   += $(CONF_SUBDIRS)
 check-recursive: tests/defs
 tests/defs: $(srcdir)/tests/defs.in
        rm -f tests/defs.tmp tests/defs; \
-       $(edit) $(srcdir)/tests/defs.in > tests/defs.tmp; \
+       $(configure_edit) $(srcdir)/tests/defs.in > tests/defs.tmp; \
        mv -f tests/defs.tmp tests/defs
 
 # Use `$(srcdir)/tests' for the benefit of non-GNU makes: this is
diff --git a/NEWS b/NEWS
index 90e33f7..d8d692e 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ New in 2.4.2 2010-12-??: git version 2.4.1a, Libtool team:
 
   - The generic approximation of the command line length limit (when getconf is
     not available) works again.  Regression introduced in v2.2.6-39-g9c3d4d8.
+  - The bug that leaked developer tool paths into the release tarballs
+    from ./bootstrap is fixed.
 
 New in 2.4 2010-09-22: git version 2.2.11a, Libtool team:
 
-- 
1.7.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]