Correct testing of emptyness of builddir, which may fail if

the user lacks read permissions on some dir (root, lost+found...)
This commit is contained in:
Pierre Labastie 2012-02-10 13:56:57 +00:00
parent f663589856
commit 92256610ee

View file

@ -49,7 +49,7 @@ clean_builddir() { #
# Test if the clean must be done. # Test if the clean must be done.
if [ "${CLEAN}" = "y" ]; then if [ "${CLEAN}" = "y" ]; then
# If empty (i.e. could contain lost+found), do not do anything # If empty (i.e. could contain lost+found), do not do anything
if $(ls $BUILDDIR/* > /dev/null 2>&1) && if $(ls -d $BUILDDIR/* > /dev/null 2>&1) &&
[ "$(ls $BUILDDIR)" != "lost+found" ]; then [ "$(ls $BUILDDIR)" != "lost+found" ]; then
# Test to make sure that the build directory was populated by jhalfs # Test to make sure that the build directory was populated by jhalfs
if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then