diff options
author | Daniel Robbins <drobbins@gentoo.org> | 2000-12-20 09:32:53 +0000 |
---|---|---|
committer | Daniel Robbins <drobbins@gentoo.org> | 2000-12-20 09:32:53 +0000 |
commit | 4685aaa9c49e975437fd11bbe575062d8162a081 (patch) | |
tree | e20b34a71190cdc951d1ad7f92cbc519d1ea1444 /sys-apps | |
parent | re-applied achim's improvements that I overwrote (diff) | |
download | gentoo-2-4685aaa9c49e975437fd11bbe575062d8162a081.tar.gz gentoo-2-4685aaa9c49e975437fd11bbe575062d8162a081.tar.bz2 gentoo-2-4685aaa9c49e975437fd11bbe575062d8162a081.zip |
important env-update fix
Diffstat (limited to 'sys-apps')
-rwxr-xr-x | sys-apps/baselayout/files/env-update | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/sys-apps/baselayout/files/env-update b/sys-apps/baselayout/files/env-update index 98a1a0126383..eba828357661 100755 --- a/sys-apps/baselayout/files/env-update +++ b/sys-apps/baselayout/files/env-update @@ -35,33 +35,33 @@ for x in fns: # process all other variables for myenv in myconfig.all_keys(): env[myenv]=myconfig.get_key(myenv) - -if os.path.exists(portage.root+"etc/ld.so.conf"): - myld=open(portage.root+"etc/ld.so.conf") - myldlines=myld.readlines() - myld.close() - oldld=[] - for x in myldlines: - #each line has at least one char (a newline) - if x[0]=="#": - continue - oldld.append(x[:-1]) - oldld.sort() - os.rename(portage.root+"etc/ld.so.conf",portage.root+"etc/ld.so.conf.bak") -else: - oldld=None -specials["LDPATH"].sort() -if oldld!=specials["LDPATH"]: - #ld.so.conf needs updating and ldconfig needs to be run - newld=open(portage.root+"etc/ld.so.conf","w") - newld.write("# ld.so.conf autogenerated by env-update; make all changes to\n") - newld.write("# contents of /etc/env.d directory\n") - for x in specials["LDPATH"]: - newld.write(x+"\n") - newld.close() - #run ldconfig here - commands.getstatusoutput("/sbin/ldconfig -r "+portage.root) -del specials["LDPATH"] +if not os.getuid(): + if os.path.exists(portage.root+"etc/ld.so.conf"): + myld=open(portage.root+"etc/ld.so.conf") + myldlines=myld.readlines() + myld.close() + oldld=[] + for x in myldlines: + #each line has at least one char (a newline) + if x[0]=="#": + continue + oldld.append(x[:-1]) + oldld.sort() + os.rename(portage.root+"etc/ld.so.conf",portage.root+"etc/ld.so.conf.bak") + else: + oldld=None + specials["LDPATH"].sort() + if oldld!=specials["LDPATH"]: + #ld.so.conf needs updating and ldconfig needs to be run + newld=open(portage.root+"etc/ld.so.conf","w") + newld.write("# ld.so.conf autogenerated by env-update; make all changes to\n") + newld.write("# contents of /etc/env.d directory\n") + for x in specials["LDPATH"]: + newld.write(x+"\n") + newld.close() + #run ldconfig here + commands.getstatusoutput("/sbin/ldconfig -r "+portage.root) + del specials["LDPATH"] if portage.root!="/": sys.exit(0) |