diff options
Diffstat (limited to 'pkg.sh')
| -rwxr-xr-x | pkg.sh | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +usage() { + echo "" + echo "Usage: $0 <add|update> <pkgname>" + echo "" + echo "This script wraps the typical AUR creation and update procedures" + echo "" + exit 1 +} + +add_pkg() { + local pkgname="$1" + [[ -z $pkgname ]] && usage + + git remote add -f $pkgname "ssh://aur@aur.archlinux.org/$pkgname.git" + git merge -s ours --no-commit "$pkgname/master" + git read-tree "--prefix=$pkgname/" -u "$pkgname/master" + git commit -m "Add $pkgname subtree" +} + +update_pkg() { + local pkgname="$1" + [[ -z $pkgname ]] && usage + + git pull -s subtree $pkgname master +} + +case "$1" in + add) + add_pkg $2 + ;; + update) + update_pkg $2 + ;; + *) + usage +esac |
