aboutsummaryrefslogtreecommitdiffstats
path: root/upload
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-06-11 18:42:08 +0200
committerMattias Andrée <maandree@operamail.com>2015-06-11 18:42:08 +0200
commit431a4ca6d3b582ba1e949b667fe278c93217f8cb (patch)
treefa0489f07c80612965ff5e6cfe6d4790d8f0087e /upload
parentupdate todo (diff)
downloadaur-packages-431a4ca6d3b582ba1e949b667fe278c93217f8cb.tar.gz
aur-packages-431a4ca6d3b582ba1e949b667fe278c93217f8cb.tar.bz2
aur-packages-431a4ca6d3b582ba1e949b667fe278c93217f8cb.tar.xz
migrating to aur4
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'upload')
-rwxr-xr-xupload64
1 files changed, 64 insertions, 0 deletions
diff --git a/upload b/upload
new file mode 100755
index 0000000..0f6ca84
--- /dev/null
+++ b/upload
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+set -e
+
+cd "$(dirname "${0}")"
+
+makepkg --install
+
+newpkg=0
+pkgname="$(. PKGBUILD && echo "${pkgname}")"
+pkgver="$(. PKGBUILD && echo "${pkgver}")"
+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@aur4.archlinux.org/${pkgname}.git" .aur
+fi
+
+version="${pkgver}"
+if [ ! "${epoch}" = 0 ]; then
+ version="${epoch}:${version}"
+fi
+if [ ! "${pkgrel}" = 1 ]; then
+ version="${version}-${pkgrel}"
+fi
+
+cp PKGBUILD .aur
+if [ ! "${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 ..
+)
+
+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
+else
+ git commit -m "Update to ${version}"
+ git push
+fi
+