diff --git a/upgpkg b/upgpkg
new file mode 100755
index 0000000..7966ac3
--- /dev/null
+++ b/upgpkg
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# upgpkg: Upgrades package versions in PKGBUILD and starts build.
+# Author: Abhishek Dasgupta <abhidg@gmail.com>
+# Thanks to cactus, profjim and daenyth for all the sed help!
+# Edited: Florian Pritz <flo@xinu.at>
+
+# I place this script in the public domain.
+
+VERSION=0.2
+
+die() {
+ local message="$1"
+ shift
+ printf "$(gettext "Error: $message")
" "$@"
+ exit 1
+}
+
+if [ -z "$1" ]; then
+ echo "upgpkg $VERSION"
+ printf "$(gettext "usage: upgpkg newver")
"
+ exit 2
+fi
+
+# Main code follows
+
+[ ! -f PKGBUILD ] && die "No "%s" in %s" "PKGBUILD" "$PWD"
+
+sed -ri '/(md5sums|sha[0-9]+sums)[ ]?=/{:a; /)/d; N; ba;}' PKGBUILD || die "Could not bump pkgver"
+source PKGBUILD
+
+if [ $(vercmp $1 $pkgver) -gt 0 ]; then
+ sed -i "s/pkgver=.*$/pkgver=$1/g" PKGBUILD
+ sed -i "s/pkgrel=.*$/pkgrel=1/g" PKGBUILD
+ makepkg -g >> PKGBUILD
+else
+ die "New version (%s) older or equal to current %s" "$1" "$pkgver"
+fi
+
+if [ -x "rebuild" ]; then
+ ./rebuild
+else
+ makepkg
+fi
--
1.7.3.2
11-01-2010, 02:25 PM
Andrea Scarpino
add upgpkg
On Monday 01 November 2010 14:38:23 Florian Pritz wrote:
> +if [ -x "rebuild" ]; then
> + ./rebuild
> +else
> + makepkg
> +fi
Which official script is named 'rebuild'?
And, this script does not use a chroot to build the package!
--
Andrea Scarpino
Arch Linux Developer
11-01-2010, 02:34 PM
Jan de Groot
add upgpkg
On Mon, 2010-11-01 at 16:25 +0100, Andrea Scarpino wrote:
> On Monday 01 November 2010 14:38:23 Florian Pritz wrote:
> > +if [ -x "rebuild" ]; then
> > + ./rebuild
> > +else
> > + makepkg
> > +fi
> Which official script is named 'rebuild'?
> And, this script does not use a chroot to build the package!
And official packages should never ever just "makepkg -g" without
actually checking the checksums generated by that. I always copy&paste
the sha1sums or sha256sums into the PKGBUILD from announcement mails, so
I know that a downloaded tarball is the same one that is announced in my
mailbox.
11-01-2010, 02:35 PM
Florian Pritz
add upgpkg
On 01.11.2010 16:25, Andrea Scarpino wrote:
> On Monday 01 November 2010 14:38:23 Florian Pritz wrote:
>> +if [ -x "rebuild" ]; then
>> + ./rebuild
>> +else
>> + makepkg
>> +fi
> Which official script is named 'rebuild'?
> And, this script does not use a chroot to build the package!
Because everyone handles chroots differently I just call a script called
"rebuild" from the same directory the PKGBUILD is in.
There you can run some build function and then automatically release the
package. (extra-i686-build; communitypkg)
diff --git a/upgpkg b/upgpkg
new file mode 100755
index 0000000..5a35057
--- /dev/null
+++ b/upgpkg
@@ -0,0 +1,117 @@
+#!/bin/bash
+
+# upgpkg: Upgrades package versions in PKGBUILD and starts build.
+# Author: Abhishek Dasgupta <abhidg@gmail.com>
+# Thanks to cactus, profjim and daenyth for all the sed help!
+# Edited: Florian Pritz <flo@xinu.at>
+
+# I place this script in the public domain.
+
+VERSION=0.4
+
+# from makepkg
+unset ALL_OFF BOLD BLUE GREEN RED YELLOW
+if [[ -t 2 ]]; then
+ # prefer terminal safe colored and bold text when tput is supported
+ if tput setaf 0 &>/dev/null; then
+ ALL_OFF="$(tput sgr0)"
+ BOLD="$(tput bold)"
+ BLUE="${BOLD}$(tput setaf 4)"
+ GREEN="${BOLD}$(tput setaf 2)"
+ RED="${BOLD}$(tput setaf 1)"
+ YELLOW="${BOLD}$(tput setaf 3)"
+ else
+ ALL_OFF="