summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-19 22:48:18 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-19 22:48:18 +0000
commit79aaf08dc0bdfa51d6dcd2a4c018a914266db8e2 (patch)
treed3effae4d5ff7085c8b7ef2c306508b3aafdf0b9
parent1fe3e59f61306840ddea1e3e0274fca6f047c0f5 (diff)
downloadportage-79aaf08dc0bdfa51d6dcd2a4c018a914266db8e2.tar.gz
portage-79aaf08dc0bdfa51d6dcd2a4c018a914266db8e2.tar.bz2
portage-79aaf08dc0bdfa51d6dcd2a4c018a914266db8e2.zip
For bug #158558, fix broken ebuild rename logic in vardbapi.move_ent().
svn path=/main/trunk/; revision=5327
-rw-r--r--pym/portage.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 325b718cb..fb8690bac 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4665,13 +4665,17 @@ class vardbapi(dbapi):
os.rename(origpath, newpath)
# We need to rename the ebuild now.
- old_eb_path = newpath+"/"+mycpsplit[1] +"-"+mycpsplit[2]
- new_eb_path = newpath+"/"+mycpsplit_new[1]+"-"+mycpsplit[2]
- if mycpsplit[3] != "r0":
- old_eb_path += "-"+mycpsplit[3]
- new_eb_path += "-"+mycpsplit[3]
- if os.path.exists(old_eb_path+".ebuild"):
- os.rename(old_eb_path+".ebuild", new_eb_path+".ebuild")
+ old_pf = catsplit(mycpv)[1]
+ new_pf = catsplit(mynewcpv)[1]
+ if new_pf != old_pf:
+ try:
+ os.rename(os.path.join(newpath, old_pf + ".ebuild"),
+ os.path.join(newpath, new_pf + ".ebuild"))
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ write_atomic(os.path.join(newpath, "PF"), new_pf+"\n")
write_atomic(os.path.join(newpath, "CATEGORY"), mynewcat+"\n")
fixdbentries([mylist], newpath)