@@ -38,12 +38,16 @@ def main():
38
38
if not os .path .isfile ('packaging/release-rsync' ):
39
39
die ('You must run this script from the top of your rsync checkout.' )
40
40
41
- now = datetime .now ()
41
+ now = datetime .now (). astimezone () # Requires python 3.6 or later
42
42
cl_today = now .strftime ('* %a %b %d %Y' )
43
43
year = now .strftime ('%Y' )
44
44
ztoday = now .strftime ('%d %b %Y' )
45
45
today = ztoday .lstrip ('0' )
46
46
47
+ # The MAINTAINER_TZ_OFFSET is a float number of hours vs UTC. It can start with '-' but not '+'.
48
+ tz_now = now .strftime ('%z' )
49
+ tz_num = tz_now [0 :1 ].replace ('+' , '' ) + str (float (tz_now [1 :3 ]) + float (tz_now [3 :]) / 60 )
50
+
47
51
curdir = os .getcwd ()
48
52
49
53
signal .signal (signal .SIGINT , signal_handler )
@@ -213,14 +217,17 @@ About to:
213
217
x_re = re .compile (r'^(#define RSYNC_VERSION).*' , re .M )
214
218
msg = f"Unable to update RSYNC_VERSION in { fn } "
215
219
txt = replace_or_die (x_re , r'\1 "%s"' % version , txt , msg )
220
+ x_re = re .compile (r'^(#define MAINTAINER_TZ_OFFSET).*' , re .M )
221
+ msg = f"Unable to update MAINTAINER_TZ_OFFSET in { fn } "
222
+ txt = replace_or_die (x_re , r'\1 ' + tz_num , txt , msg )
216
223
elif '.spec' in fn :
217
224
for var , val in specvars .items ():
218
225
x_re = re .compile (r'^%s .*' % re .escape (var ), re .M )
219
226
txt = replace_or_die (x_re , var + ' ' + val , txt , f"Unable to update { var } in { fn } " )
220
227
x_re = re .compile (r'^\* \w\w\w \w\w\w \d\d \d\d\d\d (.*)' , re .M )
221
228
txt = replace_or_die (x_re , r'%s \1' % cl_today , txt , f"Unable to update ChangeLog header in { fn } " )
222
229
elif fn == 'rsync.h' :
223
- x_re = re .compile ('(#define\s+SUBPROTOCOL_VERSION)\s+(\d+)' )
230
+ x_re = re .compile (r '(#define\s+SUBPROTOCOL_VERSION)\s+(\d+)' )
224
231
repl = lambda m : m [1 ] + ' ' + ('0' if not pre or not proto_changed else '1' if m [2 ] == '0' else m [2 ])
225
232
txt = replace_or_die (x_re , repl , txt , f"Unable to find SUBPROTOCOL_VERSION define in { fn } " )
226
233
elif fn == 'NEWS.md' :
0 commit comments