From: Benjamin Drung Date: Tue, 18 Nov 2025 18:34:52 +0000 (+0100) Subject: test: replace rev command by sed X-Git-Tag: 110~341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deda09cb76ada70628469c9b4efc79fb22b43ab2;p=thirdparty%2Fdracut-ng.git test: replace rev command by sed On Debian-based systems, the `rev` command is shipped by the bsdextrautils package. Replace the `rev` command by `sed` which is an essential command and does not need additional packages. --- diff --git a/test/container/Dockerfile-debian b/test/container/Dockerfile-debian index a30d57cc1..e8586cf5a 100644 --- a/test/container/Dockerfile-debian +++ b/test/container/Dockerfile-debian @@ -34,7 +34,6 @@ RUN \ DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \ asciidoctor \ bluez \ - bsdextrautils \ btrfs-progs \ ca-certificates \ cargo \ diff --git a/test/run-qemu b/test/run-qemu index 3105390a8..aca4b1f54 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -138,7 +138,7 @@ ARGS+=("$@") # only set -kernel if -initrd is specified initrd=$(get_initrd "${ARGS[@]}") if [[ -n $initrd ]]; then - KVERSION=$(lsinitrd "$initrd" | grep modules.dep | head -1 | rev | cut -d'/' -f2 | rev) + KVERSION=$(lsinitrd "$initrd" | grep modules.dep | head -1 | sed 's;.*/\([^/]\+\)/modules.dep;\1;') set_vmlinux_env ARGS+=(-kernel "$VMLINUZ") add_to_append "console=${console:-ttyS0},115200" diff --git a/test/test-functions b/test/test-functions index 26fd85a3f..dc93361e4 100644 --- a/test/test-functions +++ b/test/test-functions @@ -133,7 +133,7 @@ command -v test_cleanup &> /dev/null || test_cleanup() { } determine_kernel_version() { - lsinitrd "$1" | grep modules.dep | head -1 | rev | cut -d'/' -f2 | rev + lsinitrd "$1" | grep modules.dep | head -1 | sed 's;.*/\([^/]\+\)/modules.dep;\1;' } determine_kernel_image() {