diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-07 11:07:23 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-07 11:07:23 +0000 |
commit | a255d407a4e94136b57971e4bb4c9fe014c9c4b5 (patch) | |
tree | 0a24e353d95ef953a9d172f19d06a9228c49c964 /alot/version.py | |
parent | 06224ad44b7369915b32e87ad0fe102a12949191 (diff) |
make sure __init__ only reads the VERSION file
and never writes it. The file /alot/VERSION
will be provided in the future and contain the
release version string. setup.py will try to overwrite this with the result of `git describe` which will suceed only if
we are on a git checkout.
Diffstat (limited to 'alot/version.py')
-rw-r--r-- | alot/version.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/alot/version.py b/alot/version.py index 40e64bb4..1506c137 100644 --- a/alot/version.py +++ b/alot/version.py @@ -62,7 +62,7 @@ def call_git_describe(abbrev=4): return None -def read_release_version(): +def read_version(): try: f = open(VERSIONFILE, "r") @@ -77,7 +77,7 @@ def read_release_version(): return None -def write_release_version(version): +def write_version(version): f = open(VERSIONFILE, "w") f.write("%s\n" % version) f.close() @@ -85,7 +85,7 @@ def write_release_version(version): def get_git_version(abbrev=4): # Read in the version that's currently in VERSION. - release_version = read_release_version() + release_version = read_version() # First try to get the current version using “git describe”. version = call_git_describe(abbrev) @@ -105,7 +105,7 @@ def get_git_version(abbrev=4): # RELEASE-VERSION file, update the file to be current. if version != release_version: - write_release_version(version) + write_version(version) # Finally, return the current version. return version |