Some fixes for the release script & other helpers.
authorWayne Davison <wayne@opencoder.net>
Sun, 14 Jun 2020 01:03:01 +0000 (18:03 -0700)
committerWayne Davison <wayne@opencoder.net>
Sun, 14 Jun 2020 02:15:00 +0000 (19:15 -0700)
.gitignore
packaging/nightly-rsync
packaging/patch-update
packaging/pkglib.py
packaging/release-rsync

index 9c287d14625bfcf93117c1a8e2c30bc13ee6fcd6..00613f4564c5e5fa8c9b0c5bbb9ac6845dbdfa2e 100644 (file)
@@ -46,4 +46,5 @@ aclocal.m4
 /testsuite/devices-fake.test
 /testsuite/xattrs-hlink.test
 /patches
+/SaVeDiR
 .deps
index 4b4695c136cc6689237316906b98112a83d31b52..587942f58787942e1c10bb838cd744bf8ceb771c 100755 (executable)
@@ -45,7 +45,7 @@ def main():
         cmd_chk(['make', gen_target])
         cmd_chk(['rsync', '-a', *glob.glob('*.[1-9].html'), dest])
 
-        extra_files = get_extra_files()
+        gen_files = get_gen_files()
 
         confversion = get_configure_version()
 
@@ -67,7 +67,7 @@ def main():
 
         print('Creating', tar_name)
 
-        cmd_chk(['rsync', '-a', *extra_files, name_slash])
+        cmd_chk(['rsync', '-a', *gen_files, name_slash])
         cmd_chk(f"git archive --format=tar --prefix={name}/ HEAD | tar xf -")
         cmd_chk(['support/git-set-file-times', '--quiet', '--prefix', name_slash])
         cmd_chk(['fakeroot', 'tar', 'czf', os.path.join(dest, tar_name), name])
index e13679c07421529aa9ff8c70bbc26e10d2804537..1b6f1ea9e76e99010a153bb0a85342b6c5db2259 100755 (executable)
@@ -36,11 +36,11 @@ def main():
     if args.gen:
         if os.path.lexists(TMP_DIR):
             die(f'"{TMP_DIR}" must not exist in the current directory.')
-        extra_files = get_extra_files()
+        gen_files = get_gen_files()
         os.mkdir(TMP_DIR, 0o700)
         for cmd in MAKE_GEN_CMDS:
             cmd_chk(cmd)
-        cmd_chk(['rsync', '-a', *extra_files, f'{TMP_DIR}/master/'])
+        cmd_chk(['rsync', '-a', *gen_files, f'{TMP_DIR}/master/'])
 
     last_touch = time.time()
 
@@ -144,12 +144,12 @@ def update_patch(patch):
         fh.write(f"\nbased-on: {based_on}\n")
 
         if args.gen:
-            extra_files = get_extra_files()
+            gen_files = get_gen_files()
             for cmd in MAKE_GEN_CMDS:
                 cmd_chk(cmd)
-            cmd_chk(['rsync', '-a', *extra_files, f"{TMP_DIR}/{patch}/"])
+            cmd_chk(['rsync', '-a', *gen_files, f"{TMP_DIR}/{patch}/"])
         else:
-            extra_files = [ ]
+            gen_files = [ ]
         last_touch = time.time()
 
         proc = cmd_pipe(['git', 'diff', based_on])
@@ -185,7 +185,7 @@ def update_patch(patch):
                 line =  plus_re.sub(r'+++ b/\1', line)
                 fh.write(line)
             proc.communicate()
-            for fn in extra_files:
+            for fn in gen_files:
                 os.unlink(fn)
 
     return 1
index 838aac9f563a66c9f0ec69107d7cc838ac5d7ae0..b640d734c0eddffbd4ceecca382d2548469e86f6 100644 (file)
@@ -181,7 +181,7 @@ def mandate_gensend_hook():
 
 
 # Snag the GENFILES values out of the Makefile.in file and return them as a list.
-def get_extra_files():
+def get_gen_files():
     cont_re = re.compile(r'\\\n')
 
     extras = [ ]
index e84a2830687669e2e7de26e7200e0e027a14e43f..7b969b0f3a55bf01d5dead49e0100c5a3479dfc5 100755 (executable)
@@ -29,7 +29,7 @@ def main():
 
     signal.signal(signal.SIGINT, signal_handler)
 
-    extra_files = get_extra_files()
+    gen_files = get_gen_files()
 
     dash_line = '=' * 74
 
@@ -238,8 +238,8 @@ About to:
     if s.returncode:
         die('Aborting')
 
-    cmd_chk(['make', 'reconfigure'])
-    cmd_chk(['make', 'gen'])
+    cmd_chk('make reconfigure ; make gen')
+    cmd_chk(['rsync', '-a', *gen_files, 'SaVeDiR/'])
 
     print(f'Creating any missing patch branches.')
     s = cmd_run(f'packaging/branch-from-patch --branch={args.master_branch} --add-missing')
@@ -254,6 +254,10 @@ About to:
     if re.match(r'^y', ans, re.I):
         print(f'\nVisiting all "patch/{args.master_branch}/*" branches ...')
         cmd_run(f"packaging/patch-update --branch={args.master_branch} --skip-check --shell")
+        cmd_run("rm -f *.[o15] *.html")
+        cmd_chk('rsync -a SaVeDiR/ .'.split())
+        shutil.rmtree('SaVeDiR')
+        cmd_chk('make gen'.split())
 
     if os.path.isdir('patches/.git'):
         s = cmd_run(f"cd patches && git commit -a -m 'The patches for {version}.'")
@@ -293,12 +297,12 @@ About to:
     os.environ['PATH'] = ORIGINAL_PATH
 
     # Extract the generated files from the old tar.
-    tweaked_extra_files = [ f"{rsync_lastver}/{x}" for x in extra_files ]
-    cmd_run(['tar', 'xzf', lasttar_file, *tweaked_extra_files])
+    tweaked_gen_files = [ f"{rsync_lastver}/{x}" for x in gen_files ]
+    cmd_run(['tar', 'xzf', lasttar_file, *tweaked_gen_files])
     os.rename(rsync_lastver, 'a')
 
     print(f"Creating {diff_file} ...")
-    cmd_chk(['rsync', '-a', *extra_files, 'b/'])
+    cmd_chk(['rsync', '-a', *gen_files, 'b/'])
 
     sed_script = r's:^((---|\+\+\+) [ab]/[^\t]+)\t.*:\1:' # CAUTION: must not contain any single quotes!
     cmd_chk(f"(git diff v{lastversion} {v_ver} -- ':!.github'; diff -upN a b | sed -r '{sed_script}') | gzip -9 >{diff_file}")