[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Wed Jun 10 07:41:05 UTC 2020


The branch, master has been updated
       via  c5e44330 Fix double-gen of manpages.
       via  ae82762c Fix the output with -D; a few minor tweaks.
      from  2ac7401b Mention the github rsync home.

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


- Log -----------------------------------------------------------------
commit c5e44330a51ff74c0d5d744de84b5cadb3787e58
Author: Wayne Davison <wayne at opencoder.net>
Date:   Wed Jun 10 00:39:30 2020 -0700

    Fix double-gen of manpages.

commit ae82762c31d04b933f7c5b69c1a46b6082762cb4
Author: Wayne Davison <wayne at opencoder.net>
Date:   Wed Jun 10 00:26:29 2020 -0700

    Fix the output with -D; a few minor tweaks.

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

Summary of changes:
 md2man                  | 14 +++++++-------
 packaging/nightly-rsync |  9 +--------
 2 files changed, 8 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/md2man b/md2man
index 03ede269..a84154fc 100755
--- a/md2man
+++ b/md2man
@@ -124,6 +124,7 @@ def main():
         with open(fn, 'w', encoding='utf-8') as fh:
             fh.write(txt)
 
+
 def html_via_cmarkgfm(txt):
     return cmarkgfm.markdown_to_html(txt)
 
@@ -220,7 +221,7 @@ class HtmlToManPage(HTMLParser):
                 st.man_out.append(".RS\n")
                 st.p_macro = ".IP\n"
             st.list_state.append('o')
-        st.html_out.append('<' + tag + ' '.join( ' ' + var + '="' + safeText(val) + '"' for var, val in attrs_list) + '>')
+        st.html_out.append('<' + tag + ''.join(' ' + var + '="' + htmlify(val) + '"' for var, val in attrs_list) + '>')
         st.at_first_tag_in_dd = False
 
 
@@ -258,9 +259,7 @@ class HtmlToManPage(HTMLParser):
         elif tag == 'pre':
             st.in_pre = False
             st.man_out.append(manify(txt) + "\n.fi\n")
-        elif tag == 'code' and not st.in_pre:
-            add_to_txt = NORM_FONT[0]
-        elif tag == 'strong' or tag == 'b':
+        elif (tag == 'code' and not st.in_pre) or tag == 'strong' or tag == 'b':
             add_to_txt = NORM_FONT[0]
         elif tag == 'em' or  tag == 'i':
             tag = 'u' # Change it into underline to be more like the man page
@@ -293,7 +292,7 @@ class HtmlToManPage(HTMLParser):
         st = self.state
         if args.debug:
             self.output_debug('DATA', (data,))
-        st.html_out.append(safeText(data))
+        st.html_out.append(htmlify(data))
         st.txt += data
 
 
@@ -301,6 +300,7 @@ class HtmlToManPage(HTMLParser):
         import pprint
         st = self.state
         if args.debug < 2:
+            st = argparse.Namespace(**vars(st))
             if len(st.html_out) > 2:
                 st.html_out = ['...'] + st.html_out[-2:]
             if len(st.man_out) > 2:
@@ -316,7 +316,7 @@ def manify(txt):
             .replace(ULIN_FONT[0], ULIN_FONT[1]), flags=re.M)
 
 
-def safeText(txt):
+def htmlify(txt):
     return txt.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"')
 
 
@@ -332,7 +332,7 @@ def die(*msg):
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='Transform a NAME.NUM.md markdown file into a NAME.NUM.html web page & a NAME.NUM man page.', add_help=False)
     parser.add_argument('--test', action='store_true', help='Test if we can parse the input w/o updating any files.')
-    parser.add_argument('--debug', '-D', action='count', default=0, help='Output copious info on the html parsing.')
+    parser.add_argument('--debug', '-D', action='count', default=0, help='Output copious info on the html parsing. Repeat for even more.')
     parser.add_argument("--help", "-h", action="help", help="Output this help message and exit.")
     parser.add_argument('mdfile', help="The NAME.NUM.md file to parse.")
     args = parser.parse_args()
diff --git a/packaging/nightly-rsync b/packaging/nightly-rsync
index 3ec55190..021a2c58 100755
--- a/packaging/nightly-rsync
+++ b/packaging/nightly-rsync
@@ -41,6 +41,7 @@ def main():
         check_git_state('master')
         cmd_chk(['touch', 'latest-year.h'])
         cmd_chk(['make', gen_target])
+        cmd_chk(['rsync', '-a', *glob.glob('*.[1-9].html'), dest])
 
         extra_files = get_extra_files()
 
@@ -74,14 +75,6 @@ def main():
             os.unlink(nightly_symlink)
         os.symlink(tar_name, nightly_symlink)
 
-    for fn in sorted(glob.glob('*.[1-9].md')):
-        cmd_chk(['./md2man', fn])
-
-        html_src = fn.replace('.md', '.html')
-        html_dest = os.path.join(dest, html_src)
-
-        cmd_chk(['rsync', '-a', html_src, html_dest])
-
     os.chdir(dest)
 
     tar_files = list(reversed(sorted(glob.glob('rsync-HEAD-*'))))


-- 
The rsync repository.



More information about the rsync-cvs mailing list