Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: check if hg and svn directories are non-empty before updating (http://www.linux-archive.org/archlinux-pacman-development/696683-makepkg-check-if-hg-svn-directories-non-empty-before-updating.html)

Allan McRae 08-22-2012 01:37 PM

makepkg: check if hg and svn directories are non-empty before updating
 
Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/makepkg.sh.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 21c660c..8ba4ff7 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -475,7 +475,7 @@ download_hg() {
url=${url##*hg+}
url=${url%%#*}

- if [[ ! -d "$dir" ]]; then
+ if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "hg"
if ! hg clone -U "$url" "$dir"; then
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "hg"
@@ -537,7 +537,7 @@ download_svn() {
fi
url=${url%%#*}

- if [[ ! -d "$dir" ]]; then
+ if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "svn"
if ! svn checkout --config-dir "$dir" "$url" "$dir"; then
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "svn"
--
1.7.12


All times are GMT. The time now is 07:46 AM.

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