diff options
author | David Runge <dave@sleepmap.de> | 2018-01-03 23:28:28 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2018-01-03 23:28:28 +0100 |
commit | 42508b4673bf9f297d16cbaf8e053548ed57af98 (patch) | |
tree | 02fd970e9dc373f8b952dbec62347bc973b10a25 /bin | |
parent | 594d0959d8477ad34ecd9b23cdfb58ad17045646 (diff) | |
download | dotfiles-42508b4673bf9f297d16cbaf8e053548ed57af98.tar.gz dotfiles-42508b4673bf9f297d16cbaf8e053548ed57af98.tar.bz2 dotfiles-42508b4673bf9f297d16cbaf8e053548ed57af98.tar.xz dotfiles-42508b4673bf9f297d16cbaf8e053548ed57af98.zip |
bin/pkgs: Adding script to create folders for and update repositories of packages maintained for Arch Linux.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkgs | 41 |
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 |