Workaround that fixes MIME DB problems under Linux, at least when

building an image from the scratch (with empty attributes and objects
dirs). This closes bugs 194 and 253.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17364 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2006-05-08 10:40:51 +00:00
parent 2fd148f926
commit cf0b5d2551

View File

@ -80,6 +80,11 @@ echo "Deleting old MIME database ..."
$rm -rf $mimeDBDest $rm -rf $mimeDBDest
$mkdir -p $mimeDBDest $mkdir -p $mimeDBDest
mkdir -p $tmpDir mkdir -p $tmpDir
mimeTmpDir=$tmpDir/mime
mimeTmpIndex=0
# create tmp dir for the MIME conversion stuff
mkdir -p $mimeTmpDir
echo "Installing MIME database ..." echo "Installing MIME database ..."
@ -88,13 +93,13 @@ for inSuperFile in $mimeDBSource/*.super; do
outSuperDir=$mimeDBDest/$superType outSuperDir=$mimeDBDest/$superType
# compile rdef to rsrc file and the rsrc file to attributes # compile rdef to rsrc file and the rsrc file to attributes
tmpFile=$tmpDir/mimedb$$.rsrc mimeTmpIndex=$[$mimeTmpIndex + 1]
tmpFile2=$tmpDir/mimedb$$.mime tmpFile=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.rsrc
tmpFile2=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.mime
$rc -o $tmpFile $inSuperFile $rc -o $tmpFile $inSuperFile
mkdir -p $tmpFile2 mkdir -p $tmpFile2
$resattr -O -o $tmpFile2 $tmpFile $resattr -O -o $tmpFile2 $tmpFile
$cp -r ${sPrefix}$tmpFile2 $outSuperDir $cp -r ${sPrefix}$tmpFile2 $outSuperDir
rm -rf $tmpFile $tmpFile2
# iterate through the sub types # iterate through the sub types
for inSubFile in $mimeDBSource/$superType/*; do for inSubFile in $mimeDBSource/$superType/*; do
@ -104,16 +109,18 @@ for inSuperFile in $mimeDBSource/*.super; do
outSubFile=$outSuperDir/$subType outSubFile=$outSuperDir/$subType
# compile rdef to rsrc file and the rsrc file to attributes # compile rdef to rsrc file and the rsrc file to attributes
tmpFile=$tmpDir/mimedb$$.rsrc mimeTmpIndex=$[$mimeTmpIndex + 1]
tmpFile2=$tmpDir/mimedb$$.mime tmpFile=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.rsrc
tmpFile2=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.mime
$rc -o $tmpFile $inSubFile $rc -o $tmpFile $inSubFile
$resattr -O -o $tmpFile2 $tmpFile $resattr -O -o $tmpFile2 $tmpFile
$cp ${sPrefix}$tmpFile2 $outSubFile $cp ${sPrefix}$tmpFile2 $outSubFile
rm -f $tmpFile $tmpFile2
fi fi
done done
done done
# cleanup tmp dir
rm -rf $mimeTmpDir
# unmount # unmount
if [ $isImage ]; then if [ $isImage ]; then