personal cache change

1. catch exception during init
2. change local cache default path to home when
local disk is not available
diff --git a/project.py b/project.py
index e4ed7d0..3c2a58a 100644
--- a/project.py
+++ b/project.py
@@ -1746,7 +1746,8 @@
         cmd.append(str((u'+refs/heads/%s:' % branch) + remote.ToLocal('refs/heads/%s' % branch)))
       else:
         cmd.append(str((u'+%s:' % branch) + remote.ToLocal(branch)))
-
+ 
+    ok = False
     for _i in range(2):
       ret = GitCommand(self, cmd, bare=True, ssh_proxy=ssh_proxy, gitdir=self.localcache).Wait()
       if ret == 0:
@@ -2110,8 +2111,12 @@
     if not os.path.exists(self.gitdir):
 
       if self.localcache and not os.path.exists(self.localcache):
-        os.makedirs(self.localcache)
-        self.bare_cache.init()
+        try:
+            os.makedirs(self.localcache)
+            self.bare_cache.init()
+        except:
+            print("init local cache %s failed. %s" % (self.localcache, traceback.format_exc()), file=sys.stderr)
+            self.localcache = None
 
       # Initialize the bare repository, which contains all of the objects.
       if not os.path.exists(self.objdir):