automake-patches
[Top][All Lists]
Advanced

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

Re: invalid sed usage wrt. POSIX


From: Alexandre Duret-Lutz
Subject: Re: invalid sed usage wrt. POSIX
Date: Sun, 15 Jun 2003 18:19:22 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

>>> "Jens" == Jens Elkner <address@hidden> writes:

 Jens> Hi,
 Jens> I just encountered, that automake uses non-POSIX conform sed syntax wrt.
 Jens> to the expected results in lispdir.m4 . For example, it uses something 
like:

 Jens> echo '/usr/share/emacs/' | \
 Jens> sed -e '/.*\/share\/\(x\?emacs\)/ {s,,foobar/\1,;p;q;}'

 Jens> expected result is: foobar/emacs/

 Jens> However, if one has set the env var POSIXLY_CORRECT, GNU sed > 3.02.0
 Jens> produces: foobar//usr/share/emacs/
[...]
 Jens> So I suggest the following patch:

Thank you, Jens.  I'm installing it as follows on HEAD and branch-1-7.

2003-06-15  Jens Elkner  <address@hidden>  (tiny change)

        * m4/lispdir.m4 (AM_PATH_LISPDIR): Fix sed commands to work with
        POSIXLY_CORRECT=1.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.186.2.28
diff -u -r1.186.2.28 THANKS
--- THANKS      7 May 2003 21:02:10 -0000       1.186.2.28
+++ THANKS      15 Jun 2003 16:15:12 -0000
@@ -89,6 +89,7 @@
 Jeff Bailey            address@hidden
 Jeff Garzik            address@hidden
 Jeff Squyres           address@hidden
+Jens Elkner            address@hidden
 Jens Kr├╝ger            address@hidden
 Jeremy Nimmer          address@hidden
 Jerome Lovy            address@hidden
Index: m4/lispdir.m4
===================================================================
RCS file: /cvs/automake/automake/m4/lispdir.m4,v
retrieving revision 1.18
diff -u -r1.18 lispdir.m4
--- m4/lispdir.m4       19 Jul 2002 20:17:58 -0000      1.18
+++ m4/lispdir.m4       15 Jun 2003 16:15:12 -0000
@@ -4,7 +4,7 @@
 ## Almost entirely rewritten by Alexandre Oliva
 ## ------------------------
 
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 #   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-# serial 6
+# serial 7
 
 # AM_PATH_LISPDIR
 # ---------------
@@ -48,8 +48,8 @@
   AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car 
load-path) "\n")) (setq load-path (cdr load-path)))' </dev/null >conftest.out])
         am_cv_lispdir=`sed -n \
        -e 's,/$,,' \
-       -e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' \
-       -e '/.*\/share\/\(x\?emacs\/site-lisp\)$/{s,,${datadir}/\1,;p;q;}' \
+       -e 
'/.*\/lib\/x\?emacs\/site-lisp$/{s,.*/lib/\(x\?emacs/site-lisp\)$,${libdir}/\1,;p;q;}'
 \
+       -e 
'/.*\/share\/x\?emacs\/site-lisp$/{s,.*/share/\(x\?emacs/site-lisp\),${datadir}/\1,;p;q;}'
 \
        conftest.out`
        rm conftest.out
        if test -z "$am_cv_lispdir"; then
-- 
Alexandre Duret-Lutz





reply via email to

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