summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-10 18:20:58 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-10 18:20:58 +0000
commit178a0f08155ba34e1050f78b6bf6aaac37bfb9b9 (patch)
tree9403f4af4502add14b1d9eebdf325e1bc1f5c169
parent53992354a2266ad4b883b95a512c0300925188ef (diff)
downloadportage-178a0f08155ba34e1050f78b6bf6aaac37bfb9b9.tar.gz
portage-178a0f08155ba34e1050f78b6bf6aaac37bfb9b9.tar.bz2
portage-178a0f08155ba34e1050f78b6bf6aaac37bfb9b9.zip
For bug #184604, make env-update write $ in front of quoted values when appropriate.
svn path=/main/trunk/; revision=7216
-rw-r--r--pym/portage/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 8de8457b6..b91f64086 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -705,8 +705,12 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None,
env_keys = [ x for x in env if x != "LDPATH" ]
env_keys.sort()
- for x in env_keys:
- outfile.write("export %s='%s'\n" % (x, env[x]))
+ for k in env_keys:
+ v = env[k]
+ if v.startswith('$') and not v.startswith('${'):
+ outfile.write("export %s=$'%s'\n" % (k, v[1:]))
+ else:
+ outfile.write("export %s='%s'\n" % (k, v))
outfile.close()
#create /etc/csh.env for (t)csh support