Skip to content

Commit

Permalink
fixup! 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 6c51444 commit 9e268f7
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
31 changes: 23 additions & 8 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,31 @@ FROM ${TEST_BASE_IMAGE} AS test-base-rhel
RUN --mount=type=cache,target=/pkg-cache <<EOT
set -ex

rm -rf /var/cache/dnf
ln -s /pkg-cache /var/cache/dnf
echo 'keepcache=True' >> /etc/dnf/dnf.conf
if test -e /etc/os-release; then
. /etc/os-release
fi

if test -d /var/cache/yum; then
rm -rf /var/cache/yum
ln -s /pkg-cache /var/cache/yum
fi

if test -d /var/cache/dnf; then
rm -rf /var/cache/dnf
ln -s /pkg-cache /var/cache/dnf
fi

case "${ID}" in
centos)
sed 's/keepcache=0/keepcache=1/g' /etc/yum.conf
;;
*)
echo 'keepcache=True' >> /etc/dnf/dnf.conf
;;
esac

cmd_exists() {
if command -v $1 >/dev/null 2>/dev/null; then
return 0
else
return 1
fi
command -v $1 >/dev/null 2>/dev/null
}

get_dnf() {
Expand Down
1 change: 0 additions & 1 deletion src/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pkg() {
else
${xx}apk ${alpine_op} "$@" 2>/dev/null || true
fi
return
;;
debian*)
if [ "${op}" = "install" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/xx-apk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# shellcheck source=./xx-common
. "$(dirname -- $0)/xx-common"
. "$(command -v xx-common)"

flock_setup
if [ -z "$XX_APK_NOLOCK" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/xx-apt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# shellcheck source=./xx-common
. "$(dirname -- $0)/xx-common"
. "$(command -v xx-common)"

flock_setup
if [ -z "$XX_APT_NOLOCK" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/xx-cargo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ execSilent() {
}

# shellcheck source=./xx-common
. "$(dirname -- $0)/xx-common"
. "$(command -v xx-common)"

flock_setup
if [ -z "$XX_CARGO_NOLOCK" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/xx-cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ fi

setup() {
# shellcheck source=./xx-common
. "$(dirname -- $0)/xx-common"
. "$(command -v xx-common)"

flock_setup
if [ -z "$XX_CC_NOLOCK" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/xx-dnf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# shellcheck source=./xx-common
. "$(dirname -- $0)/xx-common"
. "$(command -v xx-common)"

flock_setup
if [ -z "$XX_DNF_NOLOCK" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/xx-verify
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# shellcheck source=./xx-common
. "$(dirname -- $0)/xx-common"
. "$(command -v xx-common)"

flock_setup
if [ -z "$XX_VERIFY_NOLOCK" ]; then
Expand Down

0 comments on commit 9e268f7

Please sign in to comment.