diff --git a/debian/tools/patchinstall.sh.in b/debian/tools/patchinstall.sh.in index d7ffe268..dbd655e7 100644 --- a/debian/tools/patchinstall.sh.in +++ b/debian/tools/patchinstall.sh.in @@ -315,22 +315,33 @@ elif test "$backend" = "git" -o "$backend" = "git-am"; then abort "Failed to apply patch, aborting!" fi if test "$enable_autoconf" -gt 1; then - if ! update_configure; then - abort "'autoreconf -f' failed." - fi - if ! update_protocol; then - abort "'./tools/make_requests' failed." + do_commit=0 + + # Run 'autoreconf -f' if required + if git show --pretty=format: --name-only | grep -q "^\(configure.ac\|aclocal.m4\)$"; then + if ! update_configure; then + abort "'autoreconf -f' failed." + fi + git add ./configure + git add ./include/config.h.in + do_commit=1 fi - # Add changed files, ignore failures if files are not present (shouldn't happen) - git add ./configure - git add ./include/config.h.in - git add ./include/wine/server_protocol.h - git add ./server/trace.c - git add ./server/request.h + # Run './tools/make_requests' if required + if git show --pretty=format: --name-only | grep -q "^server/"; then + if ! update_protocol; then + abort "'./tools/make_requests' failed." + fi + git add ./include/wine/server_protocol.h + git add ./server/trace.c + git add ./server/request.h + do_commit=1 + fi - if ! git commit --amend --reuse-message HEAD; then - abort "Failed to include autogenerated changes in commit." + if test "$do_commit" -ne 0; then + if ! git commit --amend --reuse-message HEAD; then + abort "Failed to include autogenerated changes in commit." + fi fi fi }} diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 297f7ad6..75acd44c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -1113,22 +1113,33 @@ elif test "$backend" = "git" -o "$backend" = "git-am"; then abort "Failed to apply patch, aborting!" fi if test "$enable_autoconf" -gt 1; then - if ! update_configure; then - abort "'autoreconf -f' failed." - fi - if ! update_protocol; then - abort "'./tools/make_requests' failed." + do_commit=0 + + # Run 'autoreconf -f' if required + if git show --pretty=format: --name-only | grep -q "^\(configure.ac\|aclocal.m4\)$"; then + if ! update_configure; then + abort "'autoreconf -f' failed." + fi + git add ./configure + git add ./include/config.h.in + do_commit=1 fi - # Add changed files, ignore failures if files are not present (shouldn't happen) - git add ./configure - git add ./include/config.h.in - git add ./include/wine/server_protocol.h - git add ./server/trace.c - git add ./server/request.h + # Run './tools/make_requests' if required + if git show --pretty=format: --name-only | grep -q "^server/"; then + if ! update_protocol; then + abort "'./tools/make_requests' failed." + fi + git add ./include/wine/server_protocol.h + git add ./server/trace.c + git add ./server/request.h + do_commit=1 + fi - if ! git commit --amend --reuse-message HEAD; then - abort "Failed to include autogenerated changes in commit." + if test "$do_commit" -ne 0; then + if ! git commit --amend --reuse-message HEAD; then + abort "Failed to include autogenerated changes in commit." + fi fi fi }