makepkg: deal with mercurial exit codes
From mercurial-2.1, "hg pull" returns 1 when there are no updates. Catch the return code and either pull the update or return an error as appropriate. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
ea32924c62
commit
9b1ab3d767
|
@ -1730,8 +1730,13 @@ devel_check() {
|
||||||
msg "$(gettext "Determining latest %s revision...")" 'hg'
|
msg "$(gettext "Determining latest %s revision...")" 'hg'
|
||||||
if [[ -d ./src/$_hgrepo ]] ; then
|
if [[ -d ./src/$_hgrepo ]] ; then
|
||||||
cd ./src/$_hgrepo
|
cd ./src/$_hgrepo
|
||||||
hg pull
|
local ret=0
|
||||||
hg update
|
hg pull || ret=$?
|
||||||
|
if (( ! ret )); then
|
||||||
|
hg update
|
||||||
|
elif (( ret != 1 )); then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
[[ ! -d ./src/ ]] && mkdir ./src/
|
[[ ! -d ./src/ ]] && mkdir ./src/
|
||||||
hg clone $_hgroot/$_hgrepo ./src/$_hgrepo
|
hg clone $_hgroot/$_hgrepo ./src/$_hgrepo
|
||||||
|
|
Loading…
Reference in New Issue