Jim Meyering wrote:
> > 2011-11-11  Bruno Haible  <[email protected]>
> >
> >       Fix test suite execution failure on OSF/1 5.1.
> >       * tests/Makefile.am (TESTS_ENVIRONMENT): Use only the portable form of
> >       the 'export' shell built-in.
> 
> Thanks, but I'd like to find a way to resolve this that does not involve
> repeating every envvar name.

If that's your requirement, how about this patch then? Tested on OSF/1 and
Solaris. With this, "make check" passes in the tests/ directory.


2011-11-12  Bruno Haible  <[email protected]>

        Fix test suite execution failure on OSF/1 5.1.
        * tests/Makefile.am (TESTS_ENVIRONMENT): Use a shell function, to
        ensure that we use only the portable form of the 'export' shell
        built-in.

--- grep-2.9.69-f91c/tests/Makefile.am  2011-10-10 14:41:27.000000000 +0200
+++ grep-2.9.69-f91c/tests/Makefile.am  2011-11-12 13:52:58.000000000 +0100
@@ -105,7 +105,20 @@
 TESTS_ENVIRONMENT =                            \
   tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.;        \
   TMPDIR=$$tmp__; export TMPDIR;               \
-  export                                       \
+                                               \
+  export_with_values ()                                        \
+  {                                                    \
+    sed_extract_var='s/=.*//';                         \
+    sed_quote_value="s/=\\(.*\\)/='\\1'/";             \
+    for arg in "$$@"; do                               \
+      var=`echo "$$arg" | sed -e "$$sed_extract_var"`; \
+      arg=`echo "$$arg" | sed -e "$$sed_quote_value"`; \
+      eval "$$arg";                                    \
+      export "$$var";                                  \
+    done;                                              \
+  };                                                   \
+                                               \
+  export_with_values                           \
   VERSION='$(VERSION)'                          \
   LOCALE_FR='$(LOCALE_FR)'                      \
   LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)'            \

-- 
In memoriam Nicholas Owen <http://en.wikipedia.org/wiki/Nicholas_Owen_(martyr)>

Reply via email to