Skip to content
Permalink
Browse files

w_package_broken: add a new function to alert a user that a package i…

…s completely broken

Also return 99 in that case, so winetricks-test can detect it
  • Loading branch information
austin987 committed Dec 24, 2019
1 parent 2884464 commit 630dd6b578493ee8374c1ad4812a5a4ab647d7bf
Showing with 33 additions and 1 deletion.
  1. +30 −1 src/winetricks
  2. +3 −0 tests/winetricks-test
@@ -300,7 +300,36 @@ w_killall()
kill -s KILL $(pgrep $1)
}

# Warn user if package is broken. Optionally provide a link to the bug report.
# Warn user if package is broken (on all arches) in the current wine version. Bug report required.
w_package_broken()
{
# FIXME: test cases for this

bug_link="$1"
bad_version="$2"
good_version="$3"

if [ -z "$bug_link" ] ; then
w_die "Bug report link required!"
fi

if [ -n "$good_version" ]; then
if ! w_wine_version_in "${bad_version},${good_version}"; then
w_warn "This package ($W_PACKAGE) is broken in ${_wine_version_stripped}. Upgrade to >=${good_version}. See ${bug_link} for more info."
exit 99
fi
elif [ -n "$bad_version" ]; then
if ! w_wine_version_in "${bad_version}"; then
w_warn "This package ($W_PACKAGE) is broken in ${_wine_version_stripped}. Broken since ${bad_version}. See ${bug_link} for more info."
exit 99
fi
else
w_warn "This package ($W_PACKAGE) is broken. See ${bug_link} for more info."
exit 99
fi
}

# Warn user if package is broken on win64. Optionally provide a link to the bug report.
w_package_broken_win64()
{
# Optional:
@@ -396,6 +396,9 @@ test_command()
skip "$command is not supported on $WINEARCH, requires win64"
archskip=1
return
elif [ "$return" = "99" ]; then
skip "$command is known to be broken on this wine version, ignoring"
return
fi

if [ "$EXPECT_FAIL" = "yes" ] ; then

0 comments on commit 630dd6b

Please sign in to comment.
You can’t perform that action at this time.