[pacman-dev] [PATCH] [makepkg] Print out full version on pkgver update

Allan McRae allan at archlinux.org
Thu Dec 13 10:37:19 EST 2012


On 14/12/12 01:29, William Giokas wrote:
> When building sources that have a pkgver() function, makepkg prints:
>   ==> Making package: $pkgname $pkgver-$pkgrel $(date)
> which, normally, works out fine. Only problem is using vcs sources with
> a pkgver() function, it will print out the old version. So, if there is
> an update, the user won't know what version the package changed to till
> after the build. This patch adds in a line that prints out
>   ==> Updated version: $pkgbase $newversion-1
> if the version has changed.
> 
> $newversion includes epoch and since an update automatically resets the
> release number to 1, that is printed as well.
> 
> Signed-off-by: William Giokas <1007380 at gmail.com>
> ---
>  scripts/makepkg.sh.in | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index d34261b..678ceb1 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -699,11 +699,8 @@ update_pkgver() {
>  		if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
>  			@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
>  			@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
> -			if [[ -n "$pkgver" ]]; then
> -				msg "$(gettext "Updated version: %s-%s to %s-1")" $pkgver $pkgrel $newpkgver
> -			else
> -				msg "$(gettext "Updated version to %s-1")" $newpkgver
> -			fi
> +			local fullver=$(get_full_version)
> +			msg "$(gettext "Updated version: %s-1")" "$pkgbase $fullver"
>  			source "$BUILDFILE"

1. this seems to be a patch on top of your old patch
2. fullver will be the old version unless it is done AFTER the source line
3. get_full_version has the pkgrel, so no need for that.
4. with all the changes your patch description does not match the patch

>  		else
>  			warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \
> 



More information about the pacman-dev mailing list