mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 09:51:50 -05:00
makepkg: complain when the buildfile isn't writeable
If the PKGBUILD isn't writeable for devel_update, throw a warning instead of silently ignoring it. Some logical reordering is present in this patch to reduce the number of nested if's. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
parent
8fe6791928
commit
468270ce4f
@ -1820,13 +1820,13 @@ devel_update() {
|
||||
# ...
|
||||
# _foo=pkgver
|
||||
#
|
||||
if [[ -n $newpkgver ]]; then
|
||||
if [[ $newpkgver != "$pkgver" ]]; then
|
||||
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
|
||||
@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
|
||||
@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
|
||||
source_safe "$BUILDFILE"
|
||||
fi
|
||||
if [[ -n $newpkgver && $newpkgver != "$pkgver" ]]; then
|
||||
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
|
||||
@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
|
||||
@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
|
||||
source "$BUILDFILE"
|
||||
else
|
||||
warning "$(gettext "%s is not writeable -- pkgver will not be updated")" "$BUILDFILE"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user