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
This commit is contained in:
François Revol 2007-11-17 22:26:17 +00:00
parent 8354ae8795
commit ef9aa9a756
1 changed files with 12 additions and 3 deletions

View File

@ -56,6 +56,15 @@ else
fi 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()
{ {
# unzipFile <archive> <directory> # unzipFile <archive> <directory>
@ -66,13 +75,13 @@ unzipFile()
if [ $isImage ]; then if [ $isImage ]; then
unzipDir=$tmpDir/unzip unzipDir=$tmpDir/unzip
rm -rf $unzipDir attrrmrf $unzipDir
mkdir -p $unzipDir mkdir -p $unzipDir
$unzip -q -d $unzipDir $zipFile $unzip -q -d $unzipDir $zipFile
$cp -r ${sPrefix}$unzipDir/. ${tPrefix}$targetUnzipDir $cp -r ${sPrefix}$unzipDir/. ${tPrefix}$targetUnzipDir
rm -rf $unzipDir attrrmrf $unzipDir
else else
$unzip -q -d ${tPrefix}$targetUnzipDir ${sPrefix}$zipFile $unzip -q -d ${tPrefix}$targetUnzipDir ${sPrefix}$zipFile
fi fi
@ -158,7 +167,7 @@ if [ ! $updateOnly ]; then
done done
# cleanup tmp dir # cleanup tmp dir
rm -rf $mimeTmpDir attrrmrf $mimeTmpDir
fi # ! updateOnly fi # ! updateOnly