X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/blobdiff_plain/453d47aec1a82cef50b71befaceae17a3df6e5d3..a2ba4d541c7f651d08fbbdd87048975b52909cc2:/setup.py diff --git a/setup.py b/setup.py index 7b0ded5..04ca821 100755 --- a/setup.py +++ b/setup.py @@ -1,9 +1,9 @@ #!/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 +from stgit import version from stgit.run import Run def __version_to_list(version): @@ -29,18 +29,18 @@ def __check_python_version(): """Check the minimum Python version """ pyver = '.'.join(str(n) for n in sys.version_info) - if not __check_min_version(python_min_ver, pyver): + if not __check_min_version(version.python_min_ver, pyver): print >> sys.stderr, 'Python version %s or newer required. Found %s' \ - % (python_min_ver, pyver) + % (version.python_min_ver, pyver) sys.exit(1) def __check_git_version(): """Check the minimum GIT version """ gitver = Run('git', '--version').output_one_line().split()[2] - if not __check_min_version(git_min_ver, gitver): + if not __check_min_version(version.git_min_ver, gitver): print >> sys.stderr, 'GIT version %s or newer required. Found %s' \ - % (git_min_ver, gitver) + % (version.git_min_ver, gitver) sys.exit(1) # Check the minimum versions required @@ -48,8 +48,11 @@ 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, + version = version.version, license = 'GPLv2', author = 'Catalin Marinas', author_email = 'catalin.marinas@gmail.com', @@ -57,7 +60,7 @@ setup(name = 'stgit', description = 'Stacked GIT', long_description = 'Push/pop utility on top of GIT', scripts = ['stg'], - packages = ['stgit', 'stgit.commands'], + packages = ['stgit', 'stgit.commands', 'stgit.lib'], data_files = [('share/stgit/templates', glob.glob('templates/*.tmpl')), ('share/stgit/examples', glob.glob('examples/*.tmpl')), ('share/stgit/examples', ['examples/gitconfig']), @@ -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)