mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
patchinstall.sh: Use /bin/sh instead of bash.
This commit is contained in:
parent
595ac8afa2
commit
a83a587270
36
debian/tools/patchinstall.sh.in
vendored
36
debian/tools/patchinstall.sh.in
vendored
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
#
|
||||
# Script to automatically install all Wine Staging patches
|
||||
#
|
||||
@ -59,18 +59,18 @@ patchlist="/dev/null"
|
||||
backend="patch"
|
||||
enable=1
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
if test "$#" -eq 0; then
|
||||
abort "No commandline arguments given, don't know what to do."
|
||||
fi
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
while test "$#" -gt 0; do
|
||||
if patch_enable "$1" "$enable"; then
|
||||
shift
|
||||
enable=1
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$enable" -ne 1 ]; then
|
||||
if test "$enable" -ne 1; then
|
||||
abort "Wrong use of -W commandline argument, expected patchname."
|
||||
fi
|
||||
|
||||
@ -111,12 +111,12 @@ while [ "$#" -gt 0 ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$enable" -ne 1 ]; then
|
||||
if test "$enable" -ne 1; then
|
||||
abort "Missing argument for -W, expected patchname."
|
||||
fi
|
||||
|
||||
# Apply the patches using gitapply.sh, a small wrapper around 'patch'
|
||||
if [ "$backend" == "patch" ]; then
|
||||
if test "$backend" = "patch"; then
|
||||
|
||||
patch_apply ()
|
||||
{{
|
||||
@ -127,7 +127,7 @@ if [ "$backend" == "patch" ]; then
|
||||
}}
|
||||
|
||||
# GIT backend - apply patches using 'git am'
|
||||
elif [ "$backend" == "git" -o "$backend" == "git-am" ]; then
|
||||
elif test "$backend" = "git" -o "$backend" = "git-am"; then
|
||||
|
||||
patch_apply ()
|
||||
{{
|
||||
@ -138,7 +138,7 @@ elif [ "$backend" == "git" -o "$backend" == "git-am" ]; then
|
||||
}}
|
||||
|
||||
# Git apply backend
|
||||
elif [ "$backend" == "git-apply" ]; then
|
||||
elif test "$backend" = "git-apply"; then
|
||||
|
||||
patch_apply ()
|
||||
{{
|
||||
@ -149,7 +149,7 @@ elif [ "$backend" == "git-apply" ]; then
|
||||
}}
|
||||
|
||||
# Stacked GIT backend - import the patches (mainly for developers)
|
||||
elif [ "$backend" == "stg" ]; then
|
||||
elif test "$backend" = "stg"; then
|
||||
|
||||
# Only import the regular patches, no autogenerated ones -
|
||||
# moreover, don't run autoreconf or ./tools/make_requests.
|
||||
@ -171,10 +171,10 @@ fi
|
||||
{patch_resolver}
|
||||
|
||||
|
||||
if [ -z "$DESTDIR" -a -f ./tools/make_requests ]; then
|
||||
if test -z "$DESTDIR" -a -f ./tools/make_requests; then
|
||||
DESTDIR="$(pwd)"
|
||||
|
||||
elif [ ! -f "$DESTDIR/tools/make_requests" ]; then
|
||||
elif test ! -f "$DESTDIR/tools/make_requests"; then
|
||||
abort "DESTDIR does not point to the Wine source tree."
|
||||
fi
|
||||
|
||||
@ -186,9 +186,9 @@ if ! cd "$curdir"; then
|
||||
fi
|
||||
|
||||
# If autoupdate is enabled then create a tempfile to keep track of all patches
|
||||
if [ "$enable_autoupdate" -eq 1 ]; then
|
||||
if test "$enable_autoupdate" -eq 1; then
|
||||
patchlist=$(mktemp)
|
||||
if [ ! -f "$patchlist" ]; then
|
||||
if test ! -f "$patchlist"; then
|
||||
echo "ERROR: Unable to create temporary file for patchlist." >&2
|
||||
exit 1
|
||||
fi
|
||||
@ -198,12 +198,12 @@ fi
|
||||
{patch_apply}
|
||||
|
||||
|
||||
if [ "$enable_autoupdate" -eq 1 ]; then
|
||||
if test "$enable_autoupdate" -eq 1; then
|
||||
|
||||
# Generate a temporary patch containing the patchlist and apply it
|
||||
patch_data=$(cat "$patchlist" | sort)
|
||||
patch_lines=$(echo "$patch_data" | wc -l)
|
||||
if [ ! -z "$patch_data" ]; then
|
||||
if test ! -z "$patch_data"; then
|
||||
patch_lines=$((${{patch_lines}}+23))
|
||||
cat > "$patchlist" <<EOF
|
||||
From: Wine Staging Team <webmaster@fds-team.de>
|
||||
@ -279,14 +279,12 @@ EOF
|
||||
rm "$patchlist"
|
||||
|
||||
# Other autogenerated changes
|
||||
pushd "$DESTDIR" > /dev/null
|
||||
if ! autoreconf -f; then
|
||||
if ! (cd "$DESTDIR" && autoreconf -f); then
|
||||
abort "'autoreconf -f' failed."
|
||||
fi
|
||||
if ! ./tools/make_requests; then
|
||||
if ! (cd "$DESTDIR" && ./tools/make_requests); then
|
||||
abort "'./tools/make_requests' failed."
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
|
||||
# Success
|
||||
|
6
debian/tools/patchupdate.py
vendored
6
debian/tools/patchupdate.py
vendored
@ -528,9 +528,9 @@ def generate_script(all_patches):
|
||||
lines = []
|
||||
for i, patch in [(i, all_patches[i]) for i in reversed(resolved)]:
|
||||
if len(patch.depends):
|
||||
lines.append("if [ \"$%s\" -eq 1 ]; then\n" % patch.variable)
|
||||
lines.append("if test \"$%s\" -eq 1; then\n" % patch.variable)
|
||||
for j in sorted(patch.depends):
|
||||
lines.append("\tif [ \"$%s\" -gt 1 ]; then\n" % all_patches[j].variable)
|
||||
lines.append("\tif test \"$%s\" -gt 1; then\n" % all_patches[j].variable)
|
||||
lines.append("\t\tabort \"Patchset %s disabled, but %s depends on that.\"\n" %
|
||||
(all_patches[j].name, patch.name))
|
||||
lines.append("\tfi\n")
|
||||
@ -557,7 +557,7 @@ def generate_script(all_patches):
|
||||
lines.append("# | Modified files:\n")
|
||||
lines.append("# | *\t%s\n" % "\n# | \t".join(textwrap.wrap(", ".join(sorted(patch.modified_files)), 120)))
|
||||
lines.append("# |\n")
|
||||
lines.append("if [ \"$%s\" -eq 1 ]; then\n" % patch.variable)
|
||||
lines.append("if test \"$%s\" -eq 1; then\n" % patch.variable)
|
||||
for f in patch.files:
|
||||
lines.append("\tpatch_apply %s\n" % os.path.join(patch.name, f))
|
||||
if len(patch.patches):
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user