public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r14758 - main/branches/2.1.7/pym/portage/dbapi
@ 2009-10-31 19:44 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-10-31 19:44 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-10-31 19:44:04 +0000 (Sat, 31 Oct 2009)
New Revision: 14758

Modified:
   main/branches/2.1.7/pym/portage/dbapi/vartree.py
Log:
Make dblink.delete() remove empty parent category directories. (trunk r14754)

Modified: main/branches/2.1.7/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/2.1.7/pym/portage/dbapi/vartree.py	2009-10-31 19:43:52 UTC (rev 14757)
+++ main/branches/2.1.7/pym/portage/dbapi/vartree.py	2009-10-31 19:44:04 UTC (rev 14758)
@@ -1230,6 +1230,11 @@
 			return
 
 		shutil.rmtree(self.dbdir)
+		# If empty, remove parent category directory.
+		try:
+			os.rmdir(os.path.dirname(self.dbdir))
+		except OSError:
+			pass
 		self.vartree.dbapi._remove(self)
 
 	def clearcontents(self):




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-31 19:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-31 19:44 [gentoo-commits] portage r14758 - main/branches/2.1.7/pym/portage/dbapi Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox