[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Tue Jun 16 21:05:34 UTC 2020


The branch, master has been updated
       via  111225a9 Fix `md2man --test` on a fresh checkout.
      from  7dfcbf7d Add g++ failure info; add mention of SSL rsyncd examples.

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 111225a99602c91dcf7dea73349bb1b8204c1a47
Author: Wayne Davison <wayne at opencoder.net>
Date:   Tue Jun 16 14:03:16 2020 -0700

    Fix `md2man --test` on a fresh checkout.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac | 14 +++++++++-----
 md2man       | 54 +++++++++++++++++++++++++++++-------------------------
 2 files changed, 38 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/configure.ac b/configure.ac
index c9e4256d..03fad912 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,12 +67,16 @@ AC_MSG_CHECKING([if md2man can create man pages])
 if test x"$ac_cv_path_PYTHON3" = x; then
     AC_MSG_RESULT(no - python3 not found)
     md2man_works=no
-elif "$srcdir/md2man" --test "$srcdir/rsync.1.md" >/dev/null 2>&1; then
-    AC_MSG_RESULT(yes)
-    md2man_works=yes
 else
-    AC_MSG_RESULT(no - need cmarkgfm or commonmark python3 lib installed)
-    md2man_works=no
+    md2man_out=`"$srcdir/md2man" --test "$srcdir/rsync.1.md" 2>&1`
+    if test $? = 0; then
+	AC_MSG_RESULT(yes)
+	md2man_works=yes
+    else
+	AC_MSG_RESULT(no)
+	md2man_works=no
+	echo "$md2man_out"
+    fi
 fi
 
 AC_MSG_CHECKING([if we require man-page building])
diff --git a/md2man b/md2man
index 7c7e7a3c..38c61f24 100755
--- a/md2man
+++ b/md2man
@@ -78,37 +78,41 @@ def main():
         fi.srcdir = './'
 
     fi.title = fi.prog + '(' + fi.sect + ') man page'
-    fi.mtime = None
+    fi.mtime = 0
 
     if os.path.lexists(fi.srcdir + '.git'):
         fi.mtime = int(subprocess.check_output('git log -1 --format=%at'.split()))
 
-    chk_files = 'NEWS.md Makefile'.split()
-    for fn in chk_files:
-        try:
-            st = os.lstat(fi.srcdir + fn)
-        except:
-            die('Failed to find', fi.srcdir + fn)
-        if not fi.mtime:
-            fi.mtime = st.st_mtime
-
-    fi.date = time.strftime('%d %b %Y', time.localtime(fi.mtime))
-
     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:
-            m = re.match(r'^(\w+)=(.+)', line)
-            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
-            if var == 'VERSION':
-                break
+    if args.test:
+        env_subs['VERSION'] = '1.0.0'
+        env_subs['libdir'] = '/usr'
+    else:
+        chk_files = 'NEWS.md Makefile'.split()
+        for fn in chk_files:
+            try:
+                st = os.lstat(fi.srcdir + fn)
+            except:
+                die('Failed to find', fi.srcdir + fn)
+            if not fi.mtime:
+                fi.mtime = st.st_mtime
+
+        with open(fi.srcdir + 'Makefile', 'r', encoding='utf-8') as fh:
+            for line in fh:
+                m = re.match(r'^(\w+)=(.+)', line)
+                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
+                if var == 'VERSION':
+                    break
+
+    fi.date = time.strftime('%d %b %Y', time.localtime(fi.mtime))
 
     with open(fi.fn, 'r', encoding='utf-8') as fh:
         txt = fh.read()


-- 
The rsync repository.



More information about the rsync-cvs mailing list