Skip to content

Commit 9e268f7

Browse files
committed
fixup! fixup! fixup! fixup! fixup! wip: add support for xx-dnf
1 parent 6c51444 commit 9e268f7

File tree

8 files changed

+29
-15
lines changed

8 files changed

+29
-15
lines changed

src/Dockerfile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,31 @@ FROM ${TEST_BASE_IMAGE} AS test-base-rhel
4242
RUN --mount=type=cache,target=/pkg-cache <<EOT
4343
set -ex
4444

45-
rm -rf /var/cache/dnf
46-
ln -s /pkg-cache /var/cache/dnf
47-
echo 'keepcache=True' >> /etc/dnf/dnf.conf
45+
if test -e /etc/os-release; then
46+
. /etc/os-release
47+
fi
48+
49+
if test -d /var/cache/yum; then
50+
rm -rf /var/cache/yum
51+
ln -s /pkg-cache /var/cache/yum
52+
fi
53+
54+
if test -d /var/cache/dnf; then
55+
rm -rf /var/cache/dnf
56+
ln -s /pkg-cache /var/cache/dnf
57+
fi
58+
59+
case "${ID}" in
60+
centos)
61+
sed 's/keepcache=0/keepcache=1/g' /etc/yum.conf
62+
;;
63+
*)
64+
echo 'keepcache=True' >> /etc/dnf/dnf.conf
65+
;;
66+
esac
4867

4968
cmd_exists() {
50-
if command -v $1 >/dev/null 2>/dev/null; then
51-
return 0
52-
else
53-
return 1
54-
fi
69+
command -v $1 >/dev/null 2>/dev/null
5570
}
5671

5772
get_dnf() {

src/test_helper.bash

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pkg() {
3737
else
3838
${xx}apk ${alpine_op} "$@" 2>/dev/null || true
3939
fi
40-
return
4140
;;
4241
debian*)
4342
if [ "${op}" = "install" ]; then

src/xx-apk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

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

88
flock_setup
99
if [ -z "$XX_APK_NOLOCK" ]; then

src/xx-apt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

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

88
flock_setup
99
if [ -z "$XX_APT_NOLOCK" ]; then

src/xx-cargo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ execSilent() {
1010
}
1111

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

1515
flock_setup
1616
if [ -z "$XX_CARGO_NOLOCK" ]; then

src/xx-cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fi
304304

305305
setup() {
306306
# shellcheck source=./xx-common
307-
. "$(dirname -- $0)/xx-common"
307+
. "$(command -v xx-common)"
308308

309309
flock_setup
310310
if [ -z "$XX_CC_NOLOCK" ]; then

src/xx-dnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

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

88
flock_setup
99
if [ -z "$XX_DNF_NOLOCK" ]; then

src/xx-verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

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

88
flock_setup
99
if [ -z "$XX_VERIFY_NOLOCK" ]; then

0 commit comments

Comments
 (0)