[xfstests-bld PATCH] setup-buildchroot: fix finding files in chroot.d

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: Eric Biggers <ebiggers@xxxxxxxxxx>

get_schroot_config() sometimes didn't find the files in
/etc/schroot/chroot.d/ because there was a typo in the regex: it used
[0-09] instead of [0-9].  Fix it, and also cat schroot.conf first so
that it doesn't get printed multiple times by the xargs command.

We also don't need to check whether schroot.conf exists, since it was
already checked in check_prerequisites(), and the 'cat' command would
fail anyway if it didn't exist.

Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
 setup-buildchroot | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/setup-buildchroot b/setup-buildchroot
index a556894..2340eb5 100755
--- a/setup-buildchroot
+++ b/setup-buildchroot
@@ -361,21 +361,14 @@ validate_binfmt_misc()
 # the chroot.d directory
 get_schroot_config()
 {
-    local files
-
-    if test ! -f $SCHROOT_CONFFILE
-    then
-	die $SCHROOT_CONFFILE does not exist
-    fi
+    cat $SCHROOT_CONFFILE
 
     if test -d $SCHROOT_CHROOT_D
     then
 	(cd $SCHROOT_CHROOT_D ;
 	 find . -maxdepth 1 -type f |
-	     egrep '^./[a-ZA-Z0-09_-][a-ZA-Z0-09_.-]*$' |
-	     xargs cat $SCHROOT_CONFFILE)
-    else
-	cat $SCHROOT_CONFFILE
+	     egrep '^./[a-ZA-Z0-9_-][a-ZA-Z0-9_.-]*$' |
+	     xargs cat)
     fi
 }
 
-- 
2.14.1.581.gf28d330327-goog

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux