From d85edf56df5b3717cc6731a0700fc88e5a536f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 9 Mar 2008 19:42:20 +0000 Subject: [PATCH] Check if /bin/stat supports the gnuish -c option, else fallback to BSD syntax. This should fix ticket #1676, please try. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24337 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/scripts/build_haiku_image | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image index a87c99f922..cb335003d6 100755 --- a/build/scripts/build_haiku_image +++ b/build/scripts/build_haiku_image @@ -65,7 +65,10 @@ attrrmrf() { test -e "$1" || return if [ -d "$outputDir/attributes" ]; then - find "$1" -print0 | xargs -0 stat -c %i | awk "{ print \"$outputDir/attributes/\" \$1 }" | xargs rm -rf + # test for gnu stat, else fallback to the bsd one. + statFormatOpt="-c" + stat -c '%i' . >/dev/null 2>&1 || statFormatOpt="-f" + find "$1" -print0 | xargs -0 stat $statFormatOpt %i | awk "{ print \"$outputDir/attributes/\" \$1 }" | xargs rm -rf fi rm -rf "$1" }