summaryrefslogtreecommitdiff
path: root/md2man
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-06-11 17:09:33 -0700
committerWayne Davison <wayne@opencoder.net>2020-06-11 19:15:08 -0700
commit66bd4774a8f67d7b822d585d4dbc269f34137cab (patch)
tree2d4f93a00de63b799b035018f35b908ccae7ea64 /md2man
parentc117fa4bf9976f3e5e284b87a2304398e4428208 (diff)
downloadrsync-66bd4774a8f67d7b822d585d4dbc269f34137cab.tar.gz
Allow maintainer to build with /usr/local prefix but document /usr.
Diffstat (limited to 'md2man')
-rwxr-xr-xmd2man4
1 files changed, 3 insertions, 1 deletions
diff --git a/md2man b/md2man
index c623efb9..c914cd96 100755
--- a/md2man
+++ b/md2man
@@ -94,7 +94,7 @@ def main():
fi.date = time.strftime('%d %b %Y', time.localtime(fi.mtime))
- env_subs = { }
+ env_subs = { 'prefix': os.environ.get('RSYNC_OVERRIDE_PREFIX', None) }
with open(fi.srcdir + 'Makefile', 'r', encoding='utf-8') as fh:
for line in fh:
@@ -102,6 +102,8 @@ def main():
if not m:
continue
var, val = (m[1], m[2])
+ if var == 'prefix' and env_subs[var] is not None:
+ continue
while re.search(r'\$\{', val):
val = re.sub(r'\$\{(\w+)\}', lambda m: env_subs[m[1]], val)
env_subs[var] = val