Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: implement an explicit preference order in sambacc installation #195

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions images/common/install-sambacc-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,42 @@ install_sambacc() {
done


local action=install-from-copr-repo
if [ "${#wheels[@]}" -gt 1 ]; then
echo "more than one wheel file found"
exit 1
elif [ "${#wheels[@]}" -eq 1 ]; then
action=install-wheel
local action=""
echo "INFO: determining sambacc installation source."
if [ "${#wheels[@]}" -gt 0 ]; then
echo "INFO: wheel found"
if [ "${#wheels[@]}" -gt 1 ]; then
echo "ERROR: more than one wheel file found"
exit 1
elif [ "${#wheels[@]}" -eq 1 ]; then
action=install-wheel
fi
fi

if [ "${#rpmfiles[@]}" -gt 1 ]; then
echo "more than one sambacc rpm file found"
exit 1
elif [ "${#rpmfiles[@]}" -eq 1 ]; then
action=install-rpm
if [ "${#rpmfiles[@]}" -gt 0 ]; then
echo "INFO: rpm file found"
if [ "${#rpmfiles[@]}" -gt 1 ]; then
echo "ERROR: more than one sambacc rpm file found"
exit 1
elif [ "${#rpmfiles[@]}" -eq 1 ]; then
action=install-rpm
fi
fi
if [ "${#repofiles[@]}" -gt 0 ]; then
echo "INFO: repo file found"
if [ "${#repofiles[@]}" -gt 1 ]; then
echo "ERROR: more than one repo file found"
exit 1
elif [ "${#repofiles[@]}" -eq 1 ]; then
action=install-from-repo
fi
fi
if [ -z "${action}" ]; then

if [ "${#repofiles[@]}" -gt 1 ]; then
echo "more than one repo file found"
exit 1
elif [ "${#repofiles[@]}" -eq 1 ]; then
action=install-from-repo
echo "INFO: no local sambacc installation source found. falling back to copr install."
action=install-from-copr-repo
fi

echo "INFO: selected installation method: '${action}'"
if [ -z "${DEFAULT_JSON_FILE}" ]; then
echo "DEFAULT_JSON_FILE value unset"
exit 1
Expand Down
Loading