[pacman-dev] [PATCH] makepkg: check if hg and svn directories are non-empty before updating

Allan McRae allan at archlinux.org
Wed Aug 22 09:37:16 EDT 2012


Signed-off-by: Allan McRae <allan at 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



More information about the pacman-dev mailing list