aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@gmail.com>2009-10-17 22:34:10 +0100
committerCatalin Marinas <cmarinas@toshiba-laptop.(none)>2009-10-17 23:25:19 +0100
commita3d0baefbc492bd8aee6d1cb7e992015beb87ea8 (patch)
tree4ac9b3ea3bb30a6e2ed866b493858b393905f8af
parent00be16b0cde8e6c6cf23f0c3e530f85a4d4fbd90 (diff)
downloadstgit-a3d0baefbc492bd8aee6d1cb7e992015beb87ea8.tar.gz
Do not delete the builtin_version.py file after setup
If setup is run in a directory without .git, setup.py deletes the stgit/builtin_version.py file and subsequent commands no longer have a version. See bug #14480. Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
-rwxr-xr-xsetup.py7
-rw-r--r--stgit/.gitignore1
-rw-r--r--stgit/version.py6
3 files changed, 3 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index 73ce2e5..3f5ccb2 100755
--- a/setup.py
+++ b/setup.py
@@ -70,11 +70,8 @@ if sys.argv[1] in ['install', 'build']:
# ensure readable template files
old_mask = os.umask(0022)
-try:
- version.write_builtin_version()
- __run_setup()
-finally:
- version.delete_builtin_version()
+version.write_builtin_version()
+__run_setup()
# restore the old mask
os.umask(old_mask)
diff --git a/stgit/.gitignore b/stgit/.gitignore
index 0d20b64..9e7f713 100644
--- a/stgit/.gitignore
+++ b/stgit/.gitignore
@@ -1 +1,2 @@
*.pyc
+builtin_version.py
diff --git a/stgit/version.py b/stgit/version.py
index 948a70b..94f89a8 100644
--- a/stgit/version.py
+++ b/stgit/version.py
@@ -43,12 +43,6 @@ def write_builtin_version():
f.write('# This file was generated automatically. Do not edit by hand.\n'
'version = %r\n' % v)
-def delete_builtin_version():
- for ext in ['py', 'pyc', 'pyo']:
- fn = _builtin_version_file(ext)
- if os.path.exists(fn):
- os.remove(fn)
-
def get_version():
for v in [builtin_version, git_describe_version]:
try: