The branch, master has been updated via 18ed3f02 More patch-update improvements; configure.ac tweak; Makefile tweaks. from 00dd50a0 Preparing for release of 3.2.2pre2
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 18ed3f02795218f29c080bdb2956faba63e42f79 Author: Wayne Davison <wa...@opencoder.net> Date: Mon Jun 29 19:46:45 2020 -0700 More patch-update improvements; configure.ac tweak; Makefile tweaks. ----------------------------------------------------------------------- Summary of changes: Makefile.in | 2 +- configure.ac | 2 +- packaging/auto-Makefile | 7 +++++-- packaging/patch-update | 56 +++++++++++++++++++++++++++++++------------------ 4 files changed, 43 insertions(+), 24 deletions(-) Changeset truncated at 500 lines: diff --git a/Makefile.in b/Makefile.in index 725ee420..f5c788db 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# The input file that configure uses to create the Makefile for rsync. +# The Makefile for rsync (configure creates it from Makefile.in). prefix=@prefix@ datarootdir=@datarootdir@ diff --git a/configure.ac b/configure.ac index 3676a716..112367cb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([rsync],[],[https://rsync.samba.org/bugtracking.html]) +AC_INIT([rsync],[ ],[https://rsync.samba.org/bugtracking.html]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([byteorder.h]) diff --git a/packaging/auto-Makefile b/packaging/auto-Makefile index 8c61e240..097a5d87 100644 --- a/packaging/auto-Makefile +++ b/packaging/auto-Makefile @@ -1,8 +1,11 @@ TARGETS := all install install-ssl-daemon install-all install-strip conf gen gensend reconfigure restatus \ proto man clean cleantests distclean test check check29 check30 installcheck splint doxygen doxygen-upload -.PHONY: $(TARGETS) +.PHONY: $(TARGETS) auto-prep -$(TARGETS): +auto-prep: @if test x`packaging/prep-auto-dir` = x; then echo "auto-build-save is not setup"; exit 1; fi + @echo 'Build branch: '`readlink build/.branch | tr % /` + +$(TARGETS): auto-prep make -C build $@ diff --git a/packaging/patch-update b/packaging/patch-update index 34530fcd..a387ad72 100755 --- a/packaging/patch-update +++ b/packaging/patch-update @@ -127,25 +127,20 @@ def update_patch(patch): s = cmd_run(['git', 'merge', based_on]) ok = s.returncode == 0 - if not ok or args.shell: + if not ok or args.cmd or args.shell: cmd_chk(['packaging/prep-auto-dir'], discard='output') - m = re.search(r'([^/]+)$', parent) - parent_dir = m[1] - if not ok: - print(f'"git merge {based_on}" incomplete -- please fix.') - os.environ['PS1'] = f"[{parent_dir}] {patch}: " - while True: - s = cmd_run([os.environ.get('SHELL', '/bin/sh')]) - if s.returncode != 0: - ans = input("Abort? [n/y] ") - if re.match(r'^y', ans, flags=re.I): - return 0 - continue - cur_branch, is_clean, status_txt = check_git_status(0) - if is_clean: - break - print(status_txt, end='') - cmd_run('rm -f build/*.o build/*/*.o') + if not ok: + print(f'"git merge {based_on}" incomplete -- please fix.') + if not run_a_shell(parent, patch): + return 0 + if args.cmd: + if cmd_run(args.cmd).returncode != 0: + if not run_a_shell(parent, patch): + return 0 + ok = False + if ok and args.shell: + if not run_a_shell(parent, patch): + return 0 with open(f"{args.patches_dir}/{patch}.diff", 'w', encoding='utf-8') as fh: fh.write(description[patch]) @@ -193,17 +188,38 @@ def update_patch(patch): line = plus_re.sub(r'+++ b/\1', line) fh.write(line) proc.communicate() - for fn in gen_files: - os.unlink(fn) return 1 +def run_a_shell(parent, patch): + m = re.search(r'([^/]+)$', parent) + parent_dir = m[1] + os.environ['PS1'] = f"[{parent_dir}] {patch}: " + + while True: + s = cmd_run([os.environ.get('SHELL', '/bin/sh')]) + if s.returncode != 0: + ans = input("Abort? [n/y] ") + if re.match(r'^y', ans, flags=re.I): + return False + continue + cur_branch, is_clean, status_txt = check_git_status(0) + if is_clean: + break + print(status_txt, end='') + + cmd_run('rm -f build/*.o build/*/*.o') + + return True + + if __name__ == '__main__': parser = argparse.ArgumentParser(description="Turn a git branch back into a diff files in the patches dir.", add_help=False) parser.add_argument('--branch', '-b', dest='base_branch', metavar='BASE_BRANCH', default='master', help="The branch the patch is based on. Default: master.") parser.add_argument('--skip-check', action='store_true', help="Skip the check that ensures starting with a clean branch.") parser.add_argument('--shell', '-s', action='store_true', help="Launch a shell for every patch/BASE/* branch updated, not just when a conflict occurs.") + parser.add_argument('--cmd', '-c', help="Run a command in every patch branch.") parser.add_argument('--gen', metavar='DIR', nargs='?', const='', help='Include generated files. Optional DIR value overrides the default of using the "patches" dir.') parser.add_argument('--patches-dir', '-p', metavar='DIR', default='patches', help="Override the location of the rsync-patches dir. Default: patches.") parser.add_argument('patch_files', metavar='patches/DIFF_FILE', nargs='*', help="Specify what patch diff files to process. Default: all of them.") -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs