diff options
author | Rob Austein <sra@hactrn.net> | 2015-10-26 06:29:00 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-10-26 06:29:00 +0000 |
commit | b46deb1417dc3596e9ac9fe2fe8cc0b7f42457e7 (patch) | |
tree | ca0dc0276d1adc168bc3337ce0564c4ec4957c1b /buildtools/make-version.py | |
parent | 397beaf6d9900dc3b3cb612c89ebf1d57b1d16f6 (diff) |
"Any programmer who fails to comply with the standard naming, formatting,
or commenting conventions should be shot. If it so happens that it is
inconvenient to shoot him, then he is to be politely requested to recode
his program in adherence to the above standard."
-- Michael Spier, Digital Equipment Corporation
svn path=/branches/tk705/; revision=6152
Diffstat (limited to 'buildtools/make-version.py')
-rw-r--r-- | buildtools/make-version.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/buildtools/make-version.py b/buildtools/make-version.py index a73a89ab..09d43801 100644 --- a/buildtools/make-version.py +++ b/buildtools/make-version.py @@ -2,11 +2,11 @@ # $Id$ # Copyright (C) 2013 Internet Systems Consortium ("ISC") -# +# # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, @@ -37,33 +37,33 @@ import sys unknown = "Unknown" try: - v = subprocess.Popen(("svnversion", "-c"), stdout = subprocess.PIPE).communicate()[0] - err = None + v = subprocess.Popen(("svnversion", "-c"), stdout = subprocess.PIPE).communicate()[0] + err = None except Exception, e: - v = unknown - err = e + v = unknown + err = e if any(s in v for s in ("Unversioned", "Uncommitted", unknown)): - v = unknown + v = unknown else: - v = "0." + v.strip().split(":")[-1].translate(None, "SMP") + v = "0." + v.strip().split(":")[-1].translate(None, "SMP") try: - old = open("VERSION", "r").read().strip() + old = open("VERSION", "r").read().strip() except: - old = None + old = None if err is not None and (old is None or old == unknown): - sys.stderr.write("Warning: No saved version and svnversion failed: %s\n" % err) + sys.stderr.write("Warning: No saved version and svnversion failed: %s\n" % err) if v == unknown: - if old is not None and old != unknown: - v = old - else: - sys.stderr.write("Warning: Could not determine software version\n") + if old is not None and old != unknown: + v = old + else: + sys.stderr.write("Warning: Could not determine software version\n") if old is None or v != old: - with open("rpki/version.py", "w") as f: - f.write("VERSION = \"%s\"\n" % v) - with open("VERSION", "w") as f: - f.write(v + "\n") + with open("rpki/version.py", "w") as f: + f.write("VERSION = \"%s\"\n" % v) + with open("VERSION", "w") as f: + f.write(v + "\n") |