Commit b8680f77c0ba372cfad8b0545ac60caf4d571c9d

Thomas de Grivel 2023-01-25T21:41:03

SHPKG_OS

diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 842b25d..eee441c 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -19,6 +19,11 @@ if [ "x${CC}" = "x" ]; then
     fi
 fi
 
+SHPKG_OS="$(uname)"
+if [ "x${SHPKG_OS}" = "xLinux" ]; then
+    SHPKG_OS="${SHPKG_OS}/$(uname -v | grep -io -e Debian -e Gentoo -e Ubuntu)"
+fi
+
 SHPKG_PREFIX="${SHPKG_DIR}"
 
 if which sha256 >/dev/null; then
@@ -42,7 +47,7 @@ SHPKG_VAR_DB_DIR="${SHPKG_DIR}/var/db/shpkg"
 
 SHPKG_FAKE_DIR="${SHPKG_TARGET_DIR}/fake"
 SHPKG_OBJ_DIR="${SHPKG_TARGET_DIR}/obj"
-SHPKG_OS_DIR="${SHPKG_SHARE_DIR}/$(uname)"
+SHPKG_OS_DIR="${SHPKG_SHARE_DIR}/${SHPKG_OS}"
 SHPKG_PACKAGE_DIR="${SHPKG_TARGET_DIR}/packages"
 SHPKG_TAG_DIR="${SHPKG_TARGET_DIR}/tag"