aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/pkgs41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/pkgs b/bin/pkgs
new file mode 100755
index 0000000..6db67f9
--- /dev/null
+++ b/bin/pkgs
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+aur_packagedir=aur-maintain
+aur_packagelist=~/.config/packages-aur.txt
+community_packagedir=svn-community
+community_root=svn+ssh://svn-community@repos.archlinux.org/srv/repos/svn-community/svn
+community_packagelist=~/.config/packages-community.txt
+packagedir=~/packages/
+
+if [ ! -d "$packagedir$aur_packagedir" ];then
+ echo "Creating AUR dir."
+ mkdir -p "$packagedir$aur_packagedir"
+fi
+
+if [ ! -d "$packagedir$community_packagedir" ];then
+ echo "Checking out [community] folder the first time."
+ cd $packagedir
+ svn checkout -N $community_root svn-community
+fi
+
+# update community packages
+cd $packagedir$community_packagedir
+for package in $(cat $community_packagelist); do
+ svn update $package
+done
+
+# update aur packages
+cd $packagedir$aur_packagedir
+for package in $(cat $aur_packagelist); do
+ if [ -d $package ]; then
+ echo "Pulling package '$package'."
+ cd $package
+ git pull
+ cd ..
+ else
+ echo "Cloning package '$package' from the AUR for the first time."
+ git clone aur@aur.archlinux.org:$package
+ fi
+done