On Mon, May 31, 2010 at 02:47:12PM -0700, Chris Larson wrote: >On Mon, May 31, 2010 at 12:13 PM, Bernhard Reutner-Fischer < >[email protected]> wrote: > >> On Mon, May 31, 2010 at 01:07:36PM -0400, Michael Smith wrote: >> >Bernhard Reutner-Fischer wrote: >> >>--- a/lib/bb/cache.py >> >>+++ b/lib/bb/cache.py >> >>@@ -64,10 +64,11 @@ class Cache: >> >>- try: >> >>- os.stat( self.cachedir ) >> >>- except OSError: >> >>- bb.mkdirhier( self.cachedir ) >> >>+ if not os.path.isdir(self.cachedir): >> >>+ try: >> >>+ bb.mkdirhier( self.cachedir ) >> >>+ except: >> >>+ raise >> > >> >Hi Bernhard, >> > >> >Is that try/except/raise necessary? >> >> probably not but, what if mkdir() fails? >> > >That block does absolutely nothing. It catches any exception and raises it >again -- no different than doing nothing, letting any exception raised by >mkdirhier. Also, that block is unnecessary if you're going to use >mkdirhier. mkdirhier creates a dir and silently does nothing if the dir >already exists, so your isdir isn't necessary, unless I'm missing something.
I was thinking about the scenario where cachedir exists but is a file. I'll remove the try/catch. _______________________________________________ Bitbake-dev mailing list [email protected] https://lists.berlios.de/mailman/listinfo/bitbake-dev
