diff options
author | Matthew Monaco <matthew.monaco@0x01b.net> | 2012-03-12 19:14:22 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-07 11:26:44 -0500 |
commit | bb71d254e2a2fbd641ce73392727762904189723 (patch) | |
tree | 04a90bfcc49fac94527d80ad2fb04b686a6f2306 /scripts/makepkg.sh.in | |
parent | 0fd477238f190976efffabd04110fb1d79448be3 (diff) | |
download | pacman-bb71d254e2a2fbd641ce73392727762904189723.tar.xz |
makepkg: devel_check(): cleanup for hg version
Use pushd/popd, quote args, handle some more errors
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r-- | scripts/makepkg.sh.in | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a486a521..14742dd0 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1761,8 +1761,7 @@ devel_check() { newpkgver=$(bzr revno ${_bzrtrunk}) ;; hg) - if [[ -d ./src/$_hgrepo ]] ; then - cd ./src/$_hgrepo + if pushd "./src/$_hgrepo" > /dev/null; then local ret=0 hg pull || ret=$? if (( ! ret )); then @@ -1772,11 +1771,14 @@ devel_check() { fi else [[ ! -d ./src/ ]] && mkdir ./src/ - hg clone $_hgroot/$_hgrepo ./src/$_hgrepo - cd ./src/$_hgrepo + hg clone "$_hgroot/$_hgrepo" "./src/$_hgrepo" + if ! pushd "./src/$_hgrepo" > /dev/null; then + warning "$(gettext "An error occured while determining the hg version number.")" + return 0 + fi fi newpkgver=$(hg tip --template "{rev}") - cd ../../ + popd > /dev/null ;; esac |