From: Wayne Davison Date: Sun, 14 Jun 2020 01:03:01 +0000 (-0700) Subject: Some fixes for the release script & other helpers. X-Git-Tag: v3.2.0pre1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a70f1420b4b2e47ae6ba0d314fb8f703746766c;p=thirdparty%2Frsync.git Some fixes for the release script & other helpers. --- diff --git a/.gitignore b/.gitignore index 9c287d14..00613f45 100644 --- a/.gitignore +++ b/.gitignore @@ -46,4 +46,5 @@ aclocal.m4 /testsuite/devices-fake.test /testsuite/xattrs-hlink.test /patches +/SaVeDiR .deps diff --git a/packaging/nightly-rsync b/packaging/nightly-rsync index 4b4695c1..587942f5 100755 --- a/packaging/nightly-rsync +++ b/packaging/nightly-rsync @@ -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]) diff --git a/packaging/patch-update b/packaging/patch-update index e13679c0..1b6f1ea9 100755 --- a/packaging/patch-update +++ b/packaging/patch-update @@ -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 diff --git a/packaging/pkglib.py b/packaging/pkglib.py index 838aac9f..b640d734 100644 --- a/packaging/pkglib.py +++ b/packaging/pkglib.py @@ -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 = [ ] diff --git a/packaging/release-rsync b/packaging/release-rsync index e84a2830..7b969b0f 100755 --- a/packaging/release-rsync +++ b/packaging/release-rsync @@ -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}")