Skip to contentSkip to conversation

run-fstests: don't assume that host system has dpkg

PATCH New Eric Biggers 1 participant 1 message Feb 8, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 run-fstests: don't assume that host system has dpkg

From: Eric Biggers <[email protected]>

dpkg is generally only present on Debian-derived distros.

Fixes 1efbdfd8c837 ("Use more general architecture handling")
---
 run-fstests/util/arch-funcs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
run-fstests/util/arch-funcs +7 -3
index 248a2a0..3933867 100644
@@ -13,12 +13,16 @@
 #
 
 function set_my_arch () {
-    local t
-
     if test -n "${MY_ARCH:=}" ; then
         return
     fi
-    MY_ARCH=$(dpkg --print-architecture)
+    local arch=$(uname -m)
+    case $arch in
+	aarch64)   MY_ARCH=arm64  ;;
+	i386|i686) MY_ARCH=i386   ;;
+	x86_64)    MY_ARCH=amd64  ;;
+	*)         MY_ARCH=$arch  ;;
+    esac
 }
 
 function set_default_arch ()
Signature · 1 line
2.39.1