1 |
Author: zmedico |
2 |
Date: 2009-10-31 19:44:04 +0000 (Sat, 31 Oct 2009) |
3 |
New Revision: 14758 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.7/pym/portage/dbapi/vartree.py |
7 |
Log: |
8 |
Make dblink.delete() remove empty parent category directories. (trunk r14754) |
9 |
|
10 |
Modified: main/branches/2.1.7/pym/portage/dbapi/vartree.py |
11 |
=================================================================== |
12 |
--- main/branches/2.1.7/pym/portage/dbapi/vartree.py 2009-10-31 19:43:52 UTC (rev 14757) |
13 |
+++ main/branches/2.1.7/pym/portage/dbapi/vartree.py 2009-10-31 19:44:04 UTC (rev 14758) |
14 |
@@ -1230,6 +1230,11 @@ |
15 |
return |
16 |
|
17 |
shutil.rmtree(self.dbdir) |
18 |
+ # If empty, remove parent category directory. |
19 |
+ try: |
20 |
+ os.rmdir(os.path.dirname(self.dbdir)) |
21 |
+ except OSError: |
22 |
+ pass |
23 |
self.vartree.dbapi._remove(self) |
24 |
|
25 |
def clearcontents(self): |