Skip to content

Commit

Permalink
common: implementi an explicit preference order in the sambacc instal…
Browse files Browse the repository at this point in the history
…l script

 this explicitly implements a preference order for sambacc
    custom installation sources like so:

    wheeel -> rpm -> local repo  -> copr.
 It makes the output a bit more verbose while at it.

Signed-off-by: Michael Adam <[email protected]>
  • Loading branch information
obnoxxx committed Jan 9, 2025
1 parent 6bae989 commit 0195a47
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions images/common/install-sambacc-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,36 @@ install_sambacc() {


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
fi

if [ "${#rpmfiles[@]}" -gt 1 ]; then
echo "more than one sambacc rpm file found"
exit 1
elif [ "${#rpmfiles[@]}" -eq 1 ]; then
action=install-rpm
fi

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

if [ -z "${DEFAULT_JSON_FILE}" ]; then
Expand Down

0 comments on commit 0195a47

Please sign in to comment.