Bug #291271 - Make vardbapi._bump_mtime() create category directories when
authorZac Medico <zmedico@gentoo.org>
Sat, 31 Oct 2009 18:59:37 +0000 (18:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 31 Oct 2009 18:59:37 +0000 (18:59 -0000)
necessary.

svn path=/main/trunk/; revision=14753

pym/portage/dbapi/vartree.py

index 049db6e40c39b1f560e4b300789a771357ff4402..db91be3d5fcba2ceec10b5b1f782df152fb8731c 100644 (file)
@@ -860,8 +860,11 @@ class vardbapi(dbapi):
                catdir = base + _os.sep + cat
                t = time.time()
                t = (t, t)
-               for x in (catdir, base):
-                       os.utime(x, t)
+               try:
+                       for x in (catdir, base):
+                               os.utime(x, t)
+               except OSError:
+                       os.makedirs(catdir)
 
        def cpv_exists(self, mykey):
                "Tells us whether an actual ebuild exists on disk (no masking)"