[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HEAD: func_quote_for_expand and Solaris 2.6 /bin/sed
From: |
Ralf Wildenhues |
Subject: |
Re: HEAD: func_quote_for_expand and Solaris 2.6 /bin/sed |
Date: |
Fri, 23 Feb 2007 19:17:56 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Hello Ralf,
* Ralf Menzel wrote on Thu, Feb 15, 2007 at 03:50:48PM CET:
> > Hm, did you consider using something like this?
[...]
> Oops, that was an early version. Here is the latest version:
>
> --- snip ---
> sed_double_backslash="\
> s/$bs4/$bs4\\
> /g
> s/^$bs2$dollar/$bs2$bs$dollar/
> s/\\([[^$bs]]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
> s/\n//g"
> --- snip ---
Looks good to me. I'm applying this to HEAD. Thank you!
Cheers,
Ralf
2007-02-23 Ralf Menzel <address@hidden> (tiny change)
* libltdl/config/general.m4sh (sed_double_backslash): Fix
hacky sed script to avoid limitations but retain portability to
Solaris /bin/sed. Remove old obsolete cruft.
Index: libltdl/config/general.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/general.m4sh,v
retrieving revision 1.5
diff -u -r1.5 general.m4sh
--- libltdl/config/general.m4sh 11 Feb 2007 11:07:08 -0000 1.5
+++ libltdl/config/general.m4sh 23 Feb 2007 18:17:26 -0000
@@ -101,28 +101,16 @@
# in input to double_quote_subst, that '$' was protected from expansion.
# Since each input `\' is now two `\'s, look for any number of runs of
# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-#
-# Note in the first, non-portable but general version, the embedded single
-# quotes serve only to enhance readability.
-#sed_double_backslash='s/^\(\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/;
-# s/\([[^\\]]\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/g'
bs='\\'
bs2='\\\\'
bs4='\\\\\\\\'
dollar='\$'
sed_double_backslash="\
+ s/$bs4/&\\
+/g
s/^$bs2$dollar/$bs&/
- s/^$bs4$bs2$dollar/$bs&/
- s/^$bs4$bs4$bs2$dollar/$bs&/
- s/^$bs4$bs4$bs4$bs2$dollar/$bs&/
- s/^$bs4$bs4$bs4$bs4$bs2$dollar/$bs&/
- s/^$bs4$bs4$bs4$bs4$bs4$bs2$dollar/$bs&/
- s/\\([[^$bs]]\\)\\($bs2$dollar\\)/\\1$bs\\2/g
- s/\\([[^$bs]]\\)\\($bs4$bs2$dollar\\)/\\1$bs\\2/g
- s/\\([[^$bs]]\\)\\($bs4$bs4$bs2$dollar\\)/\\1$bs\\2/g
- s/\\([[^$bs]]\\)\\($bs4$bs4$bs4$bs2$dollar\\)/\\1$bs\\2/g
- s/\\([[^$bs]]\\)\\($bs4$bs4$bs4$bs4$bs2$dollar\\)/\\1$bs\\2/g
- s/\\([[^$bs]]\\)\\($bs4$bs4$bs4$bs4$bs4$bs2$dollar\\)/\\1$bs\\2/g"
+ s/\\([[^$bs]]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
# Standard options:
opt_dry_run=false