From 35dc7485fb1bbbe6c1dc236f35702561516f0836 Mon Sep 17 00:00:00 2001 From: Sébastien Luttringer Date: Thu, 14 Mar 2013 03:55:41 +0100 Subject: makechrootpkg: Stat chrootdir type after existancy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move detection of chrootdir type after have check if the directory exists. This avoid the following messages when -r is not given stat: cannot read file system information for '': No such file or directory Signed-off-by: Sébastien Luttringer Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 1f0bbb2..e7e5f21 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -78,9 +78,6 @@ done # Canonicalize chrootdir, getting rid of trailing / chrootdir=$(readlink -e "$passeddir") -# Detect chrootdir filesystem type -chroottype=$(stat -f -c %T "$chrootdir") - if [[ ${copy:0:1} = / ]]; then copydir=$copy else @@ -117,6 +114,9 @@ fi umask 0022 +# Detect chrootdir filesystem type +chroottype=$(stat -f -c %T "$chrootdir") + # Lock the chroot we want to use. We'll keep this lock until we exit. # Note this is the same FD number as in mkarchroot exec 9>"$copydir.lock" -- cgit v1.2.3-54-g00ecf