From ea76b6187b461dde1c5a484c541d1c6fbcbc0cdb Mon Sep 17 00:00:00 2001 From: Adam Cooper Date: Sun, 5 Oct 2025 12:54:12 -0400 Subject: [PATCH 1/2] feat: support distro "flavors" --- pkgsearch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgsearch b/pkgsearch index f7cdf9d..8766099 100755 --- a/pkgsearch +++ b/pkgsearch @@ -133,8 +133,21 @@ has -v fzf gawk || die request="$*" if [[ -r /etc/os-release ]]; then - distro=$(awk -F'=' '"NAME" == $1 { gsub("\"", "", $2); print tolower($2); }' /etc/os-release) + # Attempt to get ID_LIKE from os-release to capture the "flavor" of the distro + # If ID_LIKE is not available, defer to ID + # If ID is not available, defer to NAME + distro=$(awk -F= ' + $1=="ID_LIKE" { gsub(/"/,"",$2); idlike=$2 } + $1=="ID" { gsub(/"/,"",$2); id=$2 } + $1=="NAME" { gsub(/"/,"",$2); name=$2 } + END { + if (idlike) print tolower(idlike) + else if (id) print tolower(id) + else if (name) print tolower(name) + } + ' /etc/os-release) distro="${distro%% *}" + echo $distro fi case "$distro" in From 666ed63843f68fc5a000b5390c5c57593a1b2be9 Mon Sep 17 00:00:00 2001 From: Adam Cooper Date: Tue, 7 Oct 2025 19:12:03 -0400 Subject: [PATCH 2/2] Remove debug message in distro selection code --- pkgsearch | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgsearch b/pkgsearch index 8766099..4ab2c46 100755 --- a/pkgsearch +++ b/pkgsearch @@ -147,7 +147,6 @@ if [[ -r /etc/os-release ]]; then } ' /etc/os-release) distro="${distro%% *}" - echo $distro fi case "$distro" in