aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-09 20:44:15 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-09 20:44:15 +0200
commit293b31cb0081a9bf61dcb0edf6e09ba965c42a1a (patch)
treeb050e1838b483143e00523b5947b79a1db9b5218
parent2752f4a462004485afb6a5486375447b10cd7c36 (diff)
downloadltask-293b31cb0081a9bf61dcb0edf6e09ba965c42a1a.tar.gz
Added ID_LIKE support, fail if no PKGMAN
-rw-r--r--libs/pkgmanager5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/pkgmanager b/libs/pkgmanager
index 7a5793a..5f5ecc3 100644
--- a/libs/pkgmanager
+++ b/libs/pkgmanager
@@ -5,6 +5,8 @@ alias sudo="sudo "
PKGMAN="/bin/false"
[ -f "/etc/os-release" ] && source /etc/os-release
+[ -z $ID ] && ID=$ID_LIKE
+
case $ID in
arch)
PKGMAN="pacman"
@@ -22,6 +24,9 @@ case $ID in
UPGRADE_CMD="upgrade -y"
FULLUPGRADE_CMD="dist-upgrade"
;;
+ *)
+ 1>&2 echo Distribution could not be determined
+ exit 1
esac
alias pkg_install="$PKGMAN $INSTALL_CMD"