File tree Expand file tree Collapse file tree 8 files changed +29
-15
lines changed Expand file tree Collapse file tree 8 files changed +29
-15
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,31 @@ FROM ${TEST_BASE_IMAGE} AS test-base-rhel
4242RUN --mount=type=cache,target=/pkg-cache <<EOT
4343set -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
4968cmd_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
5772get_dnf() {
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 33set -e
44
55# shellcheck source=./xx-common
6- . " $( dirname -- $0 ) / xx-common"
6+ . " $( command -v xx-common) "
77
88flock_setup
99if [ -z " $XX_APK_NOLOCK " ]; then
Original file line number Diff line number Diff line change 33set -e
44
55# shellcheck source=./xx-common
6- . " $( dirname -- $0 ) / xx-common"
6+ . " $( command -v xx-common) "
77
88flock_setup
99if [ -z " $XX_APT_NOLOCK " ]; then
Original file line number Diff line number Diff 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
1515flock_setup
1616if [ -z " $XX_CARGO_NOLOCK " ]; then
Original file line number Diff line number Diff line change 304304
305305setup () {
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
Original file line number Diff line number Diff line change 33set -e
44
55# shellcheck source=./xx-common
6- . " $( dirname -- $0 ) / xx-common"
6+ . " $( command -v xx-common) "
77
88flock_setup
99if [ -z " $XX_DNF_NOLOCK " ]; then
Original file line number Diff line number Diff line change 33set -e
44
55# shellcheck source=./xx-common
6- . " $( dirname -- $0 ) / xx-common"
6+ . " $( command -v xx-common) "
77
88flock_setup
99if [ -z " $XX_VERIFY_NOLOCK " ]; then
You can’t perform that action at this time.
0 commit comments