summaryrefslogtreecommitdiff
path: root/depm
diff options
context:
space:
mode:
Diffstat (limited to 'depm')
-rwxr-xr-xdepm28
1 files changed, 28 insertions, 0 deletions
diff --git a/depm b/depm
new file mode 100755
index 0000000..c939670
--- /dev/null
+++ b/depm
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+os=$(cat /etc/os-release | grep ID | head -n 1)
+DEPMFILE=Depmfile
+
+if [[ ! -f Depmfile ]]; then
+ echo "This repository does not have a Depmfile."
+ exit
+fi
+
+install_arch() {
+ ARCH_PACKAGES=$(grep ARCH_PACKAGES ${DEPMFILE} | sed 's/ARCH_PACKAGES: //g')
+ if [[ $ARCH_PACKAGES == "" ]]; then
+ echo "Repository does not have any dependencies for Arch Linux"
+ else
+ pacman -S --needed $ARCH_PACKAGES
+ fi
+}
+
+
+case $os in
+ "ID=arch") install_arch;;
+ "ID=artix")
+ echo "WARNING: You may need standard Arch Linux repositories enabled in pacman."
+ install_arch;;
+
+ *) echo "Unknown OS\n You must manually install dependencies";;
+esac