pkg_add init

This commit is contained in:
pvincent
2026-08-10 12:18:16 +04:00
parent b5f9f65111
commit c5905c2803
3 changed files with 87 additions and 2 deletions
+19 -1
View File
@@ -32,7 +32,6 @@ function _array_subtract {
declare -A exclude
for item in "${arr2[@]}"; do exclude["$item"]=1; done
result=()
for item in "${arr1[@]}"; do [[ -z ${exclude["$item"]} ]] && result+=("$item"); done
}
@@ -89,6 +88,25 @@ function _flatten_short_options {
args=("${result[@]}")
}
# DISTRO
function get_distro_like {
mapfile -t release </etc/os-release
for line in "${release[@]}"; do
case "$line" in
ID=debian | ID_LIKE=debian)
echo debian
return
;;
ID=arch | ID_LIKE=arch)
echo arch
return
;;
esac
done
return 1
}
## ==============
## Deprecated: FIXME: to remove
## ==============