Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: deal with mecurial exit codes (http://www.linux-archive.org/archlinux-pacman-development/630930-makepkg-deal-mecurial-exit-codes.html)

Allan McRae 02-09-2012 09:25 PM

makepkg: deal with mecurial exit codes
 
From mercurial-2.1, hg pull returns 1 when there are no updates.
Catch the return code and either pull the update of return an
error as appropriate.

Signed-off-by: Allan McRae <allan@archlinux.org>
---

For maint.

scripts/makepkg.sh.in | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 7d65fd5..edcd3df 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1750,8 +1750,13 @@ devel_check() {
msg "$(gettext "Determining latest %s revision...")" 'hg'
if [[ -d ./src/$_hgrepo ]] ; then
cd ./src/$_hgrepo
- hg pull
- hg update
+ local ret=0
+ hg pull || ret=$?
+ if (( ! ret )); then
+ hg update
+ elif (( ret != 1 )); then
+ return 1
+ fi
else
[[ ! -d ./src/ ]] && mkdir ./src/
hg clone $_hgroot/$_hgrepo ./src/$_hgrepo
--
1.7.9


All times are GMT. The time now is 10:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.