0001-misc-update-setup.py-for-Python-3-and-PEP-440-29420.patch
setup.py | ||
---|---|---|
32 | 32 |
version_file.close() |
33 | 33 |
return version |
34 | 34 |
if os.path.exists('.git'): |
35 |
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE) |
|
35 |
p = subprocess.Popen(['git','describe','--dirty=.dirty','--match=v*'], |
|
36 |
stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
|
36 | 37 |
result = p.communicate()[0] |
37 | 38 |
if p.returncode == 0: |
38 |
version = str(result.split()[0][1:]) |
|
39 |
version = version.replace('-', '.') |
|
39 |
result = result.decode('ascii').strip()[1:] # strip spaces/newlines and initial v |
|
40 |
if '-' in result: # not a tagged version |
|
41 |
real_number, commit_count, commit_hash = result.split('-', 2) |
|
42 |
version = '%s.post%s+%s' % (real_number, commit_count, commit_hash) |
|
43 |
else: |
|
44 |
version = result |
|
40 | 45 |
return version |
46 |
else: |
|
47 |
return '0.0.post%s' % len( |
|
48 |
subprocess.check_output( |
|
49 |
['git', 'rev-list', 'HEAD']).splitlines()) |
|
41 | 50 |
return '0' |
42 | 51 | |
43 | 52 |
class compile_translations(Command): |
44 |
- |