2021-09-08 13:58:22 +00:00
|
|
|
#!/bin/sh -e
|
2021-09-20 19:34:00 +00:00
|
|
|
aurdir="$DATA/2-standards/dev/aur"
|
|
|
|
test $# -eq 0 && cd "$aurdir" && exec $SHELL
|
2021-09-08 13:58:22 +00:00
|
|
|
command=$1
|
|
|
|
shift
|
2021-09-20 19:34:00 +00:00
|
|
|
url="ssh://aur@aur.archlinux.org/${1:-$(basename $PWD)}.git"
|
2022-04-12 17:30:12 +00:00
|
|
|
case "$command" in
|
|
|
|
(origin)
|
|
|
|
test "$(git rev-parse --git-dir)" = ".git" && git remote set-url origin "$url"
|
|
|
|
git remote -v;;
|
|
|
|
(clone)
|
|
|
|
cd "$aurdir"
|
|
|
|
git -c init.defaultBranch=master clone "$url"
|
|
|
|
cd "$1"
|
|
|
|
test -f PKGBUILD || sed "s/PKG/${1%%-git}/" ../PKGBUILD > PKGBUILD
|
|
|
|
test -f .gitignore || echo '*' > .gitignore
|
|
|
|
exec $SHELL;;
|
|
|
|
(create)
|
|
|
|
git add -f .gitignore PKGBUILD
|
|
|
|
git commit -m "Create package" "$@"
|
|
|
|
git aur push --amend;;
|
|
|
|
(commit)
|
|
|
|
makepkg --printsrcinfo > .SRCINFO
|
|
|
|
git add -f .SRCINFO
|
2022-05-03 09:22:10 +00:00
|
|
|
git commit -v "$@";;
|
2022-04-12 17:30:12 +00:00
|
|
|
(push)
|
|
|
|
updpkgsums
|
|
|
|
git add -f *.install 2>/dev/null || true
|
|
|
|
git aur commit -a "$@"
|
|
|
|
git push;;
|
|
|
|
(clean)
|
|
|
|
find "$aurdir" -mindepth 2 -maxdepth 2 \( -iname "*.pkg.tar.*" -o -type d -not -name ".*" \) \
|
|
|
|
-print -exec sudo rm -rI {} +;;
|
|
|
|
(*) echo "Unknown command!"; exit 3;;
|
2021-09-08 13:58:22 +00:00
|
|
|
esac
|