aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-01 19:54:40 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-01 19:54:40 +0200
commitf33ea96125c63e112cbef97de3b8376a38681e40 (patch)
tree89cd72698ab848f11c94404ec469f7285ee314a6 /libs
parentf602514603187dbf7195c16d82c693536c1df3be (diff)
downloadltask-f33ea96125c63e112cbef97de3b8376a38681e40.tar.gz
added libs
Diffstat (limited to 'libs')
-rw-r--r--libs/pkgmanager29
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/pkgmanager b/libs/pkgmanager
new file mode 100644
index 0000000..7c1efd3
--- /dev/null
+++ b/libs/pkgmanager
@@ -0,0 +1,29 @@
+# vi: ft=sh
+
+PKGMAN="/bin/false"
+
+[ -f "/etc/os-release" ] && source /etc/os-release
+case $ID in
+ arch)
+ PKGMAN="pacman"
+ INSTALL_CMD="--noconfirm -S"
+ REMOVE_CMD="--noconfirm -Rs"
+ UPDATE_CMD="--noconfirm -Sy"
+ UPGRADE_CMD="--noconfirm -Syu"
+ FULLUPGRADE_CMD="--noconfirm -Syu"
+ ;;
+ debian)
+ PKGMAN="apt-get"
+ INSTALL_CMD="install -y"
+ REMOVE_CMD="purge -y"
+ UPDATE_CMD="update"
+ UPGRADE_CMD="upgrade -y"
+ FULLUPGRADE_CMD="dist-upgrade"
+ ;;
+esac
+
+alias pkg_install="sudo $PKGMAN $INSTALL_CMD"
+alias pkg_remove="sudo $PKGMAN $REMOVE_CMD"
+alias pkg_update="sudo $PKGMAN $UPDATE_CMD"
+alias pkg_upgrade="sudo $PKGMAN $UPGRADE_CMD"
+alias pkg_fullupgrade="sudo $PKGMAN $FULLUPGRADE_CMD"