From ef9aa9a7563affb6e3b91e0b24c9afcb6ca5f35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 17 Nov 2007 22:26:17 +0000 Subject: [PATCH] Finally got a fix for attribute errors when building on linux without xattr. After copying the mime db or packages the files were removed, but not the corresponding attribute storage files. So when an inode got reused the file inherited those leftover attributes. We now remove them before removing the files. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22940 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/scripts/build_haiku_image | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image index 6db610e09d..c40a33414b 100755 --- a/build/scripts/build_haiku_image +++ b/build/scripts/build_haiku_image @@ -56,6 +56,15 @@ else fi +# attribute-safe rm -rf +# This makes sure there are no leftover attribute file before removing each file +attrrmrf() +{ + test -e "$1" || return + find "$1" -print0 | xargs -0 stat -c %i | awk "{ print \"$outputDir/attributes/\" \$1 }" | xargs rm -rf + rm -rf "$1" +} + unzipFile() { # unzipFile @@ -66,13 +75,13 @@ unzipFile() if [ $isImage ]; then unzipDir=$tmpDir/unzip - rm -rf $unzipDir + attrrmrf $unzipDir mkdir -p $unzipDir $unzip -q -d $unzipDir $zipFile $cp -r ${sPrefix}$unzipDir/. ${tPrefix}$targetUnzipDir - rm -rf $unzipDir + attrrmrf $unzipDir else $unzip -q -d ${tPrefix}$targetUnzipDir ${sPrefix}$zipFile fi @@ -158,7 +167,7 @@ if [ ! $updateOnly ]; then done # cleanup tmp dir - rm -rf $mimeTmpDir + attrrmrf $mimeTmpDir fi # ! updateOnly