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

svn path=/main/branches/2.1.7/; revision=14757

pym/portage/dbapi/vartree.py

index 400eab8b450940aeb098762a5315fcabbe003640..4284eff9b050ceffa5107f0dc981d039bc320a76 100644 (file)
@@ -144,8 +144,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)"