From 42508b4673bf9f297d16cbaf8e053548ed57af98 Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 3 Jan 2018 23:28:28 +0100 Subject: bin/pkgs: Adding script to create folders for and update repositories of packages maintained for Arch Linux. --- bin/pkgs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 bin/pkgs (limited to 'bin') 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 -- cgit v1.2.3-70-g09d2