[gobject-introspection] giscanner: Make _get_cachedir() Always Work on Windows



commit 011b7c4496404d60a5b62bbe7de262e37509c5fb
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jul 3 17:27:41 2014 +0800

    giscanner: Make _get_cachedir() Always Work on Windows
    
    On Windows, checking for $(HOME) will work in a MSYS shell but not in
    cmd.exe (i.e. Visual Studio command prompt), so we need to check for
    HOMEPATH when we are building under a Visual Studio command prompt to get
    the users's home directory correctly.  This will enable g-ir-doc-tool to
    work on Windows when run from cmd.exe.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732668

 giscanner/cachestore.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py
index 3d8e6fd..bcac078 100644
--- a/giscanner/cachestore.py
+++ b/giscanner/cachestore.py
@@ -45,7 +45,10 @@ def _get_versionhash():
 def _get_cachedir():
     if 'GI_SCANNER_DISABLE_CACHE' in os.environ:
         return None
-    homedir = os.environ.get('HOME')
+    if os.name == 'nt' and 'MSYSTEM' not in os.environ:
+        homedir = os.environ.get('HOMEPATH')
+    else:
+        homedir = os.environ.get('HOME')
     if homedir is None:
         return None
     if not os.path.exists(homedir):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]