Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! wip: add support for xx-dnf
Browse files Browse the repository at this point in the history
  • Loading branch information
panekj committed Jun 17, 2024
1 parent 8cdadb3 commit 6c51444
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

pkg() {
case "${op}" in
add|install)
add | install)
alpine_op="add"
op="install"
apt_opts="--no-install-recommends"
;;
del|remove)
;;
del | remove)
alpine_op="del"
op="remove"
apt_opts="--autoremove"
;;
;;
*)
printf "Unknown op"
exit 1
;;
;;
esac

case "${xx}" in
Expand All @@ -31,32 +31,32 @@ pkg() {
# - Fedora: ID_LIKE="" ID="fedora"
# - Redhat: ID_LIKE="fedora" ID="rhel"
case "${ID_LIKE}${ID}" in
alpine|chimera|adelie)
alpine | chimera | adelie)
if [ "${op}" = "install" ]; then
${xx}apk ${alpine_op} "$@"
else
${xx}apk ${alpine_op} "$@" 2>/dev/null || true
fi
return
;;
;;
debian*)
if [ "${op}" = "install" ]; then
xxrun ${xx}apt ${op} -y ${apt_opts} "$@"
else
xxrun ${xx}apt ${op} -y ${apt_opts} "$@" 2>/dev/null || true
fi
;;
;;
fedora*)
if [ "${op}" = "install" ]; then
xxrun ${xx}dnf ${op} -y "$@"
else
xxrun ${xx}dnf ${op} -y "$@" 2>/dev/null || true
fi
;;
;;
*)
printf "Unknown OS:\n\t%s\n\t%s" "${ID}" "${ID_LIKE}"
exit 1
;;
;;
esac
}

Expand Down
4 changes: 2 additions & 2 deletions src/xx-common
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ add_package() {
}

flock_setup() {
if ! test -d /var/run/lock ; then
if ! test -d /var/run/lock; then
mkdir -p /var/run/lock
fi

Expand All @@ -48,7 +48,7 @@ flock_setup() {
case "${ID}" in
fedora)
add_package util-linux-core /dev/null
;;
;;
*) ;;
esac
fi
Expand Down

0 comments on commit 6c51444

Please sign in to comment.