This allows symbolic linking of the pkg directory. Without this patch the
symbolic link to an another directory would be removed as existing pkg/
directory.

Signed-off-by: Esa Määttä <[email protected]>
---
 scripts/makepkg.sh.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b1b1b75..bd2739b 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2056,8 +2056,8 @@ if (( NOBUILD )); then
        msg "$(gettext "Sources are ready.")"
        exit 0 #E_OK
 else
-       # check for existing pkg directory; don't remove if we are repackaging
-       if [[ -d $pkgdir ]] && (( ! REPKG || PKGFUNC || SPLITPKG )); then
+       # check for existing non empty pkg directory; don't remove if we are 
repackaging
+       if [[ -n $(ls -A "$pkgdir" 2>/dev/null) ]] && (( ! REPKG || PKGFUNC || 
SPLITPKG )); then
                msg "$(gettext "Removing existing pkg/ directory...")"
                rm -rf "$pkgdir"
        fi
-- 
1.7.4


Reply via email to