The branch, master has been updated
       via  fcfdd360 Update MAINTAINER_TZ_OFFSET on release.
       via  89b84739 Fix python deprecation warning.
       via  788ecbe5 Don't edit copyright year values anymore.
      from  353506bc Improve interior dashes in long options.

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


- Log -----------------------------------------------------------------
commit fcfdd36054db18c12a85d9f42365f93c04247637
Author: Wayne Davison <wa...@opencoder.net>
Date:   Wed Jan 15 23:24:26 2025 -0800

    Update MAINTAINER_TZ_OFFSET on release.
    
    This also fixes a string with \s that wasn't a r'...' string.

commit 89b847393f53e24c38097153fc8568b85d07289c
Author: Wayne Davison <wa...@opencoder.net>
Date:   Wed Jan 15 22:36:29 2025 -0800

    Fix python deprecation warning.

commit 788ecbe5ea952bbe1498c654506264a0c4bf0ef5
Author: Wayne Davison <wa...@opencoder.net>
Date:   Wed Jan 15 22:29:17 2025 -0800

    Don't edit copyright year values anymore.

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

Summary of changes:
 packaging/release-rsync    | 11 +++++++--
 packaging/year-tweak       | 56 +---------------------------------------------
 support/git-set-file-times |  4 ++--
 3 files changed, 12 insertions(+), 59 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/release-rsync b/packaging/release-rsync
index 755a38a0..2d1486b8 100755
--- a/packaging/release-rsync
+++ b/packaging/release-rsync
@@ -38,12 +38,16 @@ def main():
     if not os.path.isfile('packaging/release-rsync'):
         die('You must run this script from the top of your rsync checkout.')
 
-    now = datetime.now()
+    now = datetime.now().astimezone() # Requires python 3.6 or later
     cl_today = now.strftime('* %a %b %d %Y')
     year = now.strftime('%Y')
     ztoday = now.strftime('%d %b %Y')
     today = ztoday.lstrip('0')
 
+    # The MAINTAINER_TZ_OFFSET is a float number of hours vs UTC. It can start 
with '-' but not '+'.
+    tz_now = now.strftime('%z')
+    tz_num = tz_now[0:1].replace('+', '') + str(float(tz_now[1:3]) + 
float(tz_now[3:]) / 60)
+
     curdir = os.getcwd()
 
     signal.signal(signal.SIGINT, signal_handler)
@@ -213,6 +217,9 @@ About to:
             x_re = re.compile(r'^(#define RSYNC_VERSION).*', re.M)
             msg = f"Unable to update RSYNC_VERSION in {fn}"
             txt = replace_or_die(x_re, r'\1 "%s"' % version, txt, msg)
+            x_re = re.compile(r'^(#define MAINTAINER_TZ_OFFSET).*', re.M)
+            msg = f"Unable to update MAINTAINER_TZ_OFFSET in {fn}"
+            txt = replace_or_die(x_re, r'\1 ' + tz_num, txt, msg)
         elif '.spec' in fn:
             for var, val in specvars.items():
                 x_re = re.compile(r'^%s .*' % re.escape(var), re.M)
@@ -220,7 +227,7 @@ About to:
             x_re = re.compile(r'^\* \w\w\w \w\w\w \d\d \d\d\d\d (.*)', re.M)
             txt = replace_or_die(x_re, r'%s \1' % cl_today, txt, f"Unable to 
update ChangeLog header in {fn}")
         elif fn == 'rsync.h':
-            x_re = re.compile('(#define\s+SUBPROTOCOL_VERSION)\s+(\d+)')
+            x_re = re.compile(r'(#define\s+SUBPROTOCOL_VERSION)\s+(\d+)')
             repl = lambda m: m[1] + ' ' + ('0' if not pre or not proto_changed 
else '1' if m[2] == '0' else m[2])
             txt = replace_or_die(x_re, repl, txt, f"Unable to find 
SUBPROTOCOL_VERSION define in {fn}")
         elif fn == 'NEWS.md':
diff --git a/packaging/year-tweak b/packaging/year-tweak
index 69d2f2ff..8a7fb98e 100755
--- a/packaging/year-tweak
+++ b/packaging/year-tweak
@@ -7,9 +7,6 @@
 import sys, os, re, argparse, subprocess
 from datetime import datetime
 
-MAINTAINER_NAME = 'Wayne Davison'
-MAINTAINER_SUF = ' ' + MAINTAINER_NAME + "\n"
-
 def main():
     latest_year = '2000'
 
@@ -22,10 +19,6 @@ def main():
         m = argparse.Namespace(**m.groupdict())
         if m.year > latest_year:
             latest_year = m.year
-        if m.fn.startswith('zlib/') or m.fn.startswith('popt/'):
-            continue
-        if re.search(r'\.(c|h|sh|test)$', m.fn):
-            maybe_edit_copyright_year(m.fn, m.year)
     proc.communicate()
 
     fn = 'latest-year.h'
@@ -39,55 +32,8 @@ def main():
             fh.write(txt)
 
 
-def maybe_edit_copyright_year(fn, year):
-    opening_lines = [ ]
-    copyright_line = None
-
-    with open(fn, 'r', encoding='utf-8') as fh:
-        for lineno, line in enumerate(fh):
-            opening_lines.append(line)
-            if lineno > 3 and not re.search(r'\S', line):
-                break
-            m = 
re.match(r'^(?P<pre>.*Copyright\s+\S+\s+)(?P<year>\d\d\d\d(?:-\d\d\d\d)?(,\s+\d\d\d\d)*)(?P<suf>.+)',
 line)
-            if not m:
-                continue
-            copyright_line = argparse.Namespace(**m.groupdict())
-            copyright_line.lineno = len(opening_lines)
-            copyright_line.is_maintainer_line = MAINTAINER_NAME in 
copyright_line.suf
-            copyright_line.txt = line
-            if copyright_line.is_maintainer_line:
-                break
-
-        if not copyright_line:
-            return
-
-        if copyright_line.is_maintainer_line:
-            cyears = copyright_line.year.split('-')
-            if year == cyears[0]:
-                cyears = [ year ]
-            else:
-                cyears = [ cyears[0], year ]
-            txt = copyright_line.pre + '-'.join(cyears) + MAINTAINER_SUF
-            if txt == copyright_line.txt:
-                return
-            opening_lines[copyright_line.lineno - 1] = txt
-        else:
-            if fn.startswith('lib/') or fn.startswith('testsuite/'):
-                return
-            txt = copyright_line.pre + year + MAINTAINER_SUF
-            opening_lines[copyright_line.lineno - 1] += txt
-
-        remaining_txt = fh.read()
-
-    print(f"Updating {fn} with year {year}")
-
-    with open(fn, 'w', encoding='utf-8') as fh:
-        fh.write(''.join(opening_lines))
-        fh.write(remaining_txt)
-
-
 if __name__ == '__main__':
-    parser = argparse.ArgumentParser(description="Grab the year of last mod 
for our c & h files and make sure the Copyright comment is up-to-date.")
+    parser = argparse.ArgumentParser(description="Grab the year of the last 
mod for our c & h files and make sure the LATEST_YEAR value is accurate.")
     args = parser.parse_args()
     main()
 
diff --git a/support/git-set-file-times b/support/git-set-file-times
index e06f0737..601248b9 100755
--- a/support/git-set-file-times
+++ b/support/git-set-file-times
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 
 import os, re, argparse, subprocess
-from datetime import datetime
+from datetime import datetime, UTC
 
 NULL_COMMIT_RE = re.compile(r'\0\0commit [a-f0-9]{40}$|\0$')
 
@@ -74,7 +74,7 @@ def print_line(fn, mtime, commit_time):
     if args.list > 1:
         ts = str(commit_time).rjust(10)
     else:
-        ts = datetime.utcfromtimestamp(commit_time).strftime("%Y-%m-%d 
%H:%M:%S")
+        ts = datetime.fromtimestamp(commit_time, UTC).strftime("%Y-%m-%d 
%H:%M:%S")
     chg = '.' if mtime == commit_time else '*'
     print(chg, ts, fn)
 


-- 
The rsync repository.

_______________________________________________
rsync-cvs mailing list
rsync-cvs@lists.samba.org
https://lists.samba.org/mailman/listinfo/rsync-cvs

Reply via email to