diff options
author | Wayne Davison <wayne@opencoder.net> | 2020-07-24 14:04:02 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2020-07-24 14:19:19 -0700 |
commit | 3f016888fd09453caf9f118e21ef4e490eac5771 (patch) | |
tree | a5608732eaca36683f7eb639010eabb87db70877 /packaging | |
parent | e5a012c95920d43691e29c8c5764c4724736190a (diff) | |
download | rsync-3f016888fd09453caf9f118e21ef4e490eac5771.tar.gz |
Add helper script for a smart rebuild.
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/patch-update | 16 | ||||
-rwxr-xr-x | packaging/smart-rebuild | 39 |
2 files changed, 52 insertions, 3 deletions
diff --git a/packaging/patch-update b/packaging/patch-update index a387ad72..aefb5224 100755 --- a/packaging/patch-update +++ b/packaging/patch-update @@ -127,18 +127,27 @@ def update_patch(patch): s = cmd_run(['git', 'merge', based_on]) ok = s.returncode == 0 - if not ok or args.cmd or args.shell: + skip_shell = False + if not ok or args.cmd or args.rebuild or args.shell: cmd_chk(['packaging/prep-auto-dir'], discard='output') if not ok: print(f'"git merge {based_on}" incomplete -- please fix.') if not run_a_shell(parent, patch): return 0 + if not args.rebuild and not args.cmd: + skip_shell = True + if args.rebuild: + if cmd_run(['packaging/smart-rebuild']).returncode != 0: + if not run_a_shell(parent, patch): + return 0 + if not args.cmd: + skip_shell = True 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: + skip_shell = True + if args.shell and not skip_shell: if not run_a_shell(parent, patch): return 0 @@ -220,6 +229,7 @@ if __name__ == '__main__': 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('--rebuild', '-r', help="Run the smart-rebuild script 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.") diff --git a/packaging/smart-rebuild b/packaging/smart-rebuild new file mode 100755 index 00000000..c614f79d --- /dev/null +++ b/packaging/smart-rebuild @@ -0,0 +1,39 @@ +#!/bin/sh -e + +make=`which make || which gmake` + +branch=`packaging/prep-auto-dir` +if test x"$branch" = x; then + srcdir=. +else + cd build + srcdir=.. +fi + +if test -f configure.sh; then + cp -p configure.sh configure.sh.old +else + touch configure.sh.old +fi + +if test -f .fetch; then + $srcdir/prepare-source fetch +else + $srcdir/prepare-source +fi + +if diff configure.sh configure.sh.old >/dev/null 2>&1; then + echo "configure.sh is unchanged." + rm configure.sh.old +else + echo "configure.sh has CHANGED." + ./config.status --recheck +fi + +./config.status + +$make all + +if test x"$1" = x"check"; then + $make check +fi |