fix bad substitution in pym/portage/const_autotool.py (disappearing backslashes)...
authorFabian Groffen <grobian@gentoo.org>
Sun, 2 Aug 2009 14:27:30 +0000 (14:27 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 2 Aug 2009 14:27:30 +0000 (14:27 -0000)
svn path=/main/branches/prefix/; revision=13875

subst-install.in

index d02968e0a36dc2ba6e6f44e054b5b1097344a65b..5665550643915e4d61dab4a442579b63fd6f61a2 100644 (file)
@@ -4,6 +4,16 @@
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 
+# for bug #279550 we have to do some nasty trick to make sure that sed
+# doesn't strip the backslash in the replacement value (because it can
+# be a backreference) and hence escape those.
+rootuser="@rootuser@"
+portagegroup="@portagegroup@"
+portageuser="@portageuser@"
+rootuser=${rootuser//\\/\\\\}
+portagegroup=${portagegroup//\\/\\\\}
+portageuser=${portageuser//\\/\\\\}
+
 # there are many ways to do this all dynamic, but we only care for raw
 # speed here, so let configure fill in this list and be done with it
 at='@'
@@ -24,11 +34,11 @@ sedexp=(
        -e "s,${at}PORTAGE_WGET${at},@PORTAGE_WGET@,g"
        -e "s,${at}PORTAGE_XARGS${at},@PORTAGE_XARGS@,g"
        -e "s,${at}datadir${at},@datadir@,g"
-       -e "s,${at}portagegroup${at},@portagegroup@,g"
-       -e "s,${at}portageuser${at},@portageuser@,g"
+       -e "s,${at}portagegroup${at},${portagegroup},g"
+       -e "s,${at}portageuser${at},${portageuser},g"
        -e "s,${at}rootgid${at},@rootgid@,g"
        -e "s,${at}rootuid${at},@rootuid@,g"
-       -e "s,${at}rootuser${at},@rootuser@,g"
+       -e "s,${at}rootuser${at},${rootuser},g"
        -e "s,${at}sysconfdir${at},@sysconfdir@,g"
 )