eutils.eclass: e{cvs,svn,git}_clean: make empty arg testing more correct
authorMike Frysinger <vapier@gentoo.org>
Fri, 29 Jan 2016 22:54:50 +0000 (17:54 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 29 Jan 2016 22:54:50 +0000 (17:54 -0500)
-z $* tests whether any args are non-empty, not whether any where
specified.  Check $# instead for accurate results.

eclass/eutils.eclass

index 68c28138cce11be176897f24c9f17fe0559c911f..d23a5b7db8fe393eb7bdf26a8f4f016d519c27ca 100644 (file)
@@ -39,7 +39,7 @@ fi
 # Remove CVS directories recursiveley.  Useful when a source tarball contains
 # internal CVS directories.  Defaults to $PWD.
 ecvs_clean() {
-       [[ -z $* ]] && set -- .
+       [[ $# -eq 0 ]] && set -- .
        find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf
        find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf
 }
@@ -50,7 +50,7 @@ ecvs_clean() {
 # Remove .svn directories recursiveley.  Useful when a source tarball contains
 # internal Subversion directories.  Defaults to $PWD.
 esvn_clean() {
-       [[ -z $* ]] && set -- .
+       [[ $# -eq 0 ]] && set -- .
        find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
 }
 
@@ -60,7 +60,7 @@ esvn_clean() {
 # Remove .git* directories/files recursiveley.  Useful when a source tarball
 # contains internal Git directories.  Defaults to $PWD.
 egit_clean() {
-       [[ -z $* ]] && set -- .
+       [[ $# -eq 0 ]] && set -- .
        find "$@" -type d -name '.git*' -prune -print0 | xargs -0 rm -rf
 }