Skip to content

Commit 77c30ee

Browse files
committed
please.sh upgrade: make sure not to decrement pkgrel
It is possible that there were no changes since the latest release, and that the pkgrel was not forced to a higher number manually. In this case, we might set it to 1 by mistake (instead of erroring out because nothing needs to be built). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c308b65 commit 77c30ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

please.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,14 @@ maybe_force_pkgrel () {
22762276
sed -i "s/^\\(pkgrel=\\).*/\\1"$((1+${blame##*=}))/ PKGBUILD
22772277
fi
22782278
fi
2279+
2280+
# make sure that we did not downgrade
2281+
if test 0 -ge $(($(git diff HEAD -- PKGBUILD |
2282+
sed -n 's/^\([-+]\)pkgrel=\([0-9]*\)$/\1\2/p' | tr -d '\n')))
2283+
then
2284+
die 'pkgrel must not be downgraded:\n\n%s\n' \
2285+
"$(git diff HEAD -- PKGBUILD)"
2286+
fi
22792287
}
22802288

22812289
# --force overwrites existing an Git tag, or existing package files

0 commit comments

Comments
 (0)