patchinstall.sh: Add commandline option '--force-autoconf' to include autogenerated changes in each commit.

This commit is contained in:
Sebastian Lackner 2015-05-06 19:46:15 +02:00
parent dd18228f7d
commit 1bb34e22a6
2 changed files with 96 additions and 6 deletions

View File

@ -32,6 +32,7 @@ usage()
echo "Configuration:"
echo " DESTDIR=path Specify the path to the wine source tree"
echo " --all Select all patches"
echo " --force-autoconf Run autoreconf and tools/make_requests after each patch"
echo " --help Display this help and exit"
echo " --no-patchlist Do not apply patchlist (needed for 'wine --patches')"
echo " --no-autoconf Do not run autoreconf and tools/make_requests"
@ -111,6 +112,11 @@ while test "$#" -gt 0; do
shift
;;
--force-autoconf)
enable_autoconf=2
shift
;;
--help)
usage
exit 0
@ -246,6 +252,11 @@ if test "$backend" = "patch"; then
gitapply_args=""
fi
if test "$enable_autoconf" -gt 1; then
warning "Ignoring commandline argument --force-autoconf."
enable_autoconf=1
fi
patch_apply_file ()
{{
echo "Applying $1"
@ -270,13 +281,19 @@ elif test "$backend" = "epatch"; then
abort "Shell functions epatch/ebegin/eend not found. You have to source this script from your ebuild."
fi
if test "$enable_autoconf" -gt 1; then
warning "Ignoring commandline argument --force-autoconf."
enable_autoconf=1
fi
patch_apply_file ()
{{
shortname="$(basename "$1")"
if grep -q "^GIT binary patch" "$1"; then
ebegin "Applying $shortname"
"$patchdir/gitapply.sh" $gitapply_args < "$1" || \
if ! "$patchdir/gitapply.sh" $gitapply_args < "$1"; then
die "Failed Patch: $1!"
fi
eend
else
@ -297,6 +314,25 @@ elif test "$backend" = "git" -o "$backend" = "git-am"; then
if ! git am "$1"; 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."
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
if ! git commit --amend --reuse-message HEAD; then
abort "Failed to include autogenerated changes in commit."
fi
fi
}}
# Git apply backend
@ -306,6 +342,11 @@ elif test "$backend" = "git-apply"; then
abort "Backend 'git-apply' not possible when DESTDIR points to a git subdirectory."
fi
if test "$enable_autoconf" -gt 1; then
warning "Ignoring commandline argument --force-autoconf."
enable_autoconf=1
fi
patch_apply_file ()
{{
echo "Applying $1"
@ -411,8 +452,12 @@ EOF
fi
if test "$enable_autoconf" -eq 1; then
update_configure || abort "'autoreconf -f' failed."
update_protocol || abort "'./tools/make_requests' failed."
if ! update_configure; then
abort "'autoreconf -f' failed."
fi
if ! update_protocol; then
abort "'./tools/make_requests' failed."
fi
fi
# Success
exit 0

View File

@ -32,6 +32,7 @@ usage()
echo "Configuration:"
echo " DESTDIR=path Specify the path to the wine source tree"
echo " --all Select all patches"
echo " --force-autoconf Run autoreconf and tools/make_requests after each patch"
echo " --help Display this help and exit"
echo " --no-patchlist Do not apply patchlist (needed for 'wine --patches')"
echo " --no-autoconf Do not run autoreconf and tools/make_requests"
@ -909,6 +910,11 @@ while test "$#" -gt 0; do
shift
;;
--force-autoconf)
enable_autoconf=2
shift
;;
--help)
usage
exit 0
@ -1044,6 +1050,11 @@ if test "$backend" = "patch"; then
gitapply_args=""
fi
if test "$enable_autoconf" -gt 1; then
warning "Ignoring commandline argument --force-autoconf."
enable_autoconf=1
fi
patch_apply_file ()
{
echo "Applying $1"
@ -1068,13 +1079,19 @@ elif test "$backend" = "epatch"; then
abort "Shell functions epatch/ebegin/eend not found. You have to source this script from your ebuild."
fi
if test "$enable_autoconf" -gt 1; then
warning "Ignoring commandline argument --force-autoconf."
enable_autoconf=1
fi
patch_apply_file ()
{
shortname="$(basename "$1")"
if grep -q "^GIT binary patch" "$1"; then
ebegin "Applying $shortname"
"$patchdir/gitapply.sh" $gitapply_args < "$1" || \
if ! "$patchdir/gitapply.sh" $gitapply_args < "$1"; then
die "Failed Patch: $1!"
fi
eend
else
@ -1095,6 +1112,25 @@ elif test "$backend" = "git" -o "$backend" = "git-am"; then
if ! git am "$1"; 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."
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
if ! git commit --amend --reuse-message HEAD; then
abort "Failed to include autogenerated changes in commit."
fi
fi
}
# Git apply backend
@ -1104,6 +1140,11 @@ elif test "$backend" = "git-apply"; then
abort "Backend 'git-apply' not possible when DESTDIR points to a git subdirectory."
fi
if test "$enable_autoconf" -gt 1; then
warning "Ignoring commandline argument --force-autoconf."
enable_autoconf=1
fi
patch_apply_file ()
{
echo "Applying $1"
@ -5319,8 +5360,12 @@ EOF
fi
if test "$enable_autoconf" -eq 1; then
update_configure || abort "'autoreconf -f' failed."
update_protocol || abort "'./tools/make_requests' failed."
if ! update_configure; then
abort "'autoreconf -f' failed."
fi
if ! update_protocol; then
abort "'./tools/make_requests' failed."
fi
fi
# Success
exit 0