[pacman-dev] [PATCH] makepkg: exit if updating pkgver fails

Dave Reisner d at falconindy.com
Mon Oct 14 07:02:14 EDT 2013


On Oct 14, 2013 2:52 AM, "Allan McRae" <allan at archlinux.org> wrote:
>
> From: Zach Buhman <zack at buhman.org>
>
> [Allan: add details to failure message]
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
>  scripts/makepkg.sh.in | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index cedef4c..db344a3 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -813,7 +813,11 @@ update_pkgver() {
>
>         if [[ -n $newpkgver && $newpkgver != "$pkgver" ]]; then
>                 if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
> -                       @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/"
"$BUILDFILE"
> +                       if ! @SEDINPLACE@ "s/^pkgver=[^
]*/pkgver=$newpkgver/" "$BUILDFILE"; then
> +                               error "$(gettext "Failure updating %s
from %s to %s")"
> +                                               "pkgver" "$pkgver"
"$newpkgver"
> +                               exit 1

This does not work. Failure to match in not a program failure.

> +                       fi
>                         @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/"
"$BUILDFILE"
>                         source_safe "$BUILDFILE"
>                         local fullver=$(get_full_version)
> --
> 1.8.4
>
>


More information about the pacman-dev mailing list