chiark / gitweb /
Set umask to 0022 during the setup.py execution
authorCatalin Marinas <catalin.marinas@gmail.com>
Mon, 24 Mar 2008 10:16:05 +0000 (10:16 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 24 Mar 2008 10:16:05 +0000 (10:16 +0000)
This allows template files to be installed with the proper rights.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
setup.py

index e3f932ca4e6012e36cb1824c77e1bd70846970e0..3be087cbba164b395515e4b6dd388221a7073449 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import sys, glob
+import sys, glob, os
 from distutils.core import setup
 
 from stgit.version import version, git_min_ver, python_min_ver
@@ -48,6 +48,9 @@ if sys.argv[1] in ['install', 'build']:
     __check_python_version()
     __check_git_version()
 
+# ensure readable template files
+old_mask = os.umask(0022)
+
 setup(name = 'stgit',
       version = version,
       license = 'GPLv2',
@@ -66,3 +69,6 @@ setup(name = 'stgit',
                                              'contrib/stgit-completion.bash']),
                     ('share/doc/stgit', glob.glob('doc/*.txt'))]
       )
+
+# restore the old mask
+os.umask(old_mask)