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"
|
2021-09-08 13:58:22 +00:00
|
|
|
case $command in
|
2021-09-20 19:34:00 +00:00
|
|
|
(origin)
|
2021-09-29 16:38:57 +00:00
|
|
|
test "$(git rev-parse --git-dir)" = ".git" && git remote set-url origin "$url"
|
|
|
|
git remote -v;;
|
2021-09-08 13:58:22 +00:00
|
|
|
(clone)
|
2021-09-20 19:34:00 +00:00
|
|
|
cd "$aurdir"
|
|
|
|
git -c init.defaultBranch=master clone "$url"
|
2021-09-08 13:58:22 +00:00
|
|
|
cd "$1"
|
2021-09-18 20:02:28 +00:00
|
|
|
test -f PKGBUILD || sed "s/PKG/${1%%-git}/" ../PKGBUILD > PKGBUILD
|
|
|
|
test -f .gitignore || echo '*' > .gitignore
|
2021-09-08 13:58:22 +00:00
|
|
|
exec $SHELL;;
|
|
|
|
(create)
|
2021-09-18 20:02:28 +00:00
|
|
|
git add -f .gitignore PKGBUILD
|
2021-09-08 13:58:22 +00:00
|
|
|
git commit -m "Create package" "$@"
|
|
|
|
git aur push --amend;;
|
2021-09-18 20:02:28 +00:00
|
|
|
(push)
|
2022-03-18 07:50:53 +00:00
|
|
|
updpkgsums
|
2021-09-18 20:02:28 +00:00
|
|
|
makepkg --printsrcinfo > .SRCINFO
|
2021-11-10 16:23:46 +00:00
|
|
|
git add -f .SRCINFO *.install 2>/dev/null || true
|
2021-09-08 13:58:22 +00:00
|
|
|
git commit -v -a "$@"
|
|
|
|
git push;;
|
2022-03-29 11:51:18 +00:00
|
|
|
(clean)
|
|
|
|
find "$aurdir" -mindepth 2 -maxdepth 2 \( -name "*.tar.gz" -o -type d -not -name ".*" \) \
|
|
|
|
-print -exec sudo rm -rI {} +;;
|
|
|
|
(*) echo "Unknown command!"; exit 3;;
|
2021-09-08 13:58:22 +00:00
|
|
|
esac
|
|
|
|
|