summaryrefslogtreecommitdiff
path: root/md2man
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-06-28 13:46:48 -0700
committerWayne Davison <wayne@opencoder.net>2020-06-28 15:02:19 -0700
commit3b4f5fb891e57ecda3fe09c3b93fc458c8cc81a7 (patch)
tree6c19ee1a231e77a7c74d9fbedf40c72cb50d99e5 /md2man
parent76064b1bf29b132bbc684a27520d9cf465239f0f (diff)
downloadrsync-3b4f5fb891e57ecda3fe09c3b93fc458c8cc81a7.tar.gz
Move the version string out of configure.ac.
Diffstat (limited to 'md2man')
-rwxr-xr-xmd2man9
1 files changed, 7 insertions, 2 deletions
diff --git a/md2man b/md2man
index ef4e58d6..992d7320 100755
--- a/md2man
+++ b/md2man
@@ -93,7 +93,7 @@ def main():
env_subs['VERSION'] = '1.0.0'
env_subs['libdir'] = '/usr'
else:
- for fn in (fi.srcdir + 'NEWS.md', 'Makefile'):
+ for fn in (fi.srcdir + 'version.h', 'Makefile'):
try:
st = os.lstat(fn)
except:
@@ -101,6 +101,11 @@ def main():
if not fi.mtime:
fi.mtime = st.st_mtime
+ with open(fi.srcdir + 'version.h', 'r', encoding='utf-8') as fh:
+ txt = fh.read()
+ m = re.search(r'"(.+?)"', txt)
+ env_subs['VERSION'] = m.group(1)
+
with open('Makefile', 'r', encoding='utf-8') as fh:
for line in fh:
m = re.match(r'^(\w+)=(.+)', line)
@@ -112,7 +117,7 @@ def main():
while re.search(r'\$\{', val):
val = re.sub(r'\$\{(\w+)\}', lambda m: env_subs[m.group(1)], val)
env_subs[var] = val
- if var == 'VERSION':
+ if var == 'srcdir':
break
with open(fi.fn, 'r', encoding='utf-8') as fh: