aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-08 21:00:16 +0200
committerMattias Andrée <m@maandree.se>2024-10-08 21:00:16 +0200
commite3e5bcee7fc494d7de1fb629928142b3fa579cf3 (patch)
tree6935f1cf8a959fcf3798cc06dc28642ed9dba7d5
parentcleanup (diff)
downloadaur-packages-e3e5bcee7fc494d7de1fb629928142b3fa579cf3.tar.gz
aur-packages-e3e5bcee7fc494d7de1fb629928142b3fa579cf3.tar.bz2
aur-packages-e3e5bcee7fc494d7de1fb629928142b3fa579cf3.tar.xz
Improve upload script
Signed-off-by: Mattias Andrée <m@maandree.se>
-rwxr-xr-xupload84
1 files changed, 53 insertions, 31 deletions
diff --git a/upload b/upload
index d1b555f..756378b 100755
--- a/upload
+++ b/upload
@@ -4,7 +4,18 @@ set -e
cd "$(dirname "${0}")"
-if test ! "${SKIP_BUILD}" = y; then
+message=
+skip_build=n
+
+for arg;
+ if test "${arg}" = skip_build; then
+ skip_build=y
+ elif test "${arg::8}" = message=; then
+ message="${arg:8}"
+ fi
+do
+
+if test ! "${skip_build}" = y; then
makepkg --install --clean
fi
@@ -15,37 +26,37 @@ pkgrel="$(pkgrel=1 && . PKGBUILD && echo "${pkgrel}")"
epoch="$(epoch=0 && . PKGBUILD && echo "${epoch}")"
install="$(install="" && . PKGBUILD && echo "${install}")"
-if [ ! -d .aur ]; then
- newpkg=1
- git clone "ssh://aur@aur.archlinux.org/${pkgname}.git" .aur
+if test ! -d .aur; then
+ newpkg=1
+ git clone "ssh://aur@aur.archlinux.org/${pkgname}.git" .aur
fi
version="${pkgver}"
-if [ ! "${epoch}" = 0 ]; then
- version="${epoch}:${version}"
+if test ! "${epoch}" = 0; then
+ version="${epoch}:${version}"
fi
-if [ ! "${pkgrel}" = 1 ]; then
- version="${version}-${pkgrel}"
+if test ! "${pkgrel}" = 1; then
+ version="${version}-${pkgrel}"
fi
cp PKGBUILD .aur
-if [ ! "${install}" = "" ]; then
- cp "${install}" .aur
- cd .aur
- git add "${install}"
- cd ..
+if test ! "${install}" = ""; then
+ cp "${install}" .aur
+ cd .aur
+ git add "${install}"
+ cd ..
fi
(
- . PKGBUILD
- cd .aur
- for file in "${source[@]}"; do
- if [ -f ../"${file}" ]; then
- cp ../"${file}" .
- git add "${file}"
- fi
- done
- cd ..
+ . PKGBUILD
+ cd .aur
+ for file in "${source[@]}"; do
+ if test -f ../"${file}"; then
+ cp ../"${file}" .
+ git add "${file}"
+ fi
+ done
+ cd ..
)
cd .aur
@@ -53,14 +64,25 @@ cd .aur
mksrcinfo
git add PKGBUILD .SRCINFO
-if [ ${newpkg} = 1 ]; then
- git commit -m "Initial import, version ${version}"
- git push origin master
-elif [ ! "${pkgrel}" = 1 ]; then
- git commit -m "Update package release to ${version}"
- git push
+if test ${newpkg} = 1; then
+ if test -z "${message}"; then
+ git commit -m "Initial import, version ${version}"
+ else
+ git commit -m "${message}"
+ fi
+ git push origin master
+elif test ! "${pkgrel}" = 1; then
+ if test -z "${message}"; then
+ git commit -m "Update package release to ${version}"
+ else
+ git commit -m "${message}"
+ fi
+ git push
else
- git commit -m "Update to ${version}"
- git push
+ if test -z "${message}"; then
+ git commit -m "Update to ${version}"
+ else
+ git commit -m "${message}"
+ fi
+ git push
fi
-