#!/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