1if [ "$1" = install ] 2then 3# backing out existing entries to avoid duplicates 4sed ' 5/^# OpenOffice.org/d 6/^application\/vnd\.oasis\.opendocument/d 7/^application\/vnd\.openofficeorg/d 8/^application\/vnd\.sun/d 9/^application\/vnd\.stardivision/d 10/^application\/vnd\.ms-word/d 11/^application\/vnd\.ms-excel/d 12/^application\/vnd\.ms-powerpoint/d 13/^application\/x-star/d 14/excel/d 15/ms[-]*word/d 16/powerpoint/d 17' ${PKG_INSTALL_ROOT}/etc/mailcap 2>/dev/null 18 19# now append our stuff to the temporary file 20cat << END 21# OpenOffice.org 22application/vnd.oasis.opendocument.text; %PREFIX -view %s 23application/vnd.oasis.opendocument.text-template; %PREFIX -view %s 24application/vnd.oasis.opendocument.text-web; %PREFIX -view %s 25application/vnd.oasis.opendocument.text-master; %PREFIX -view %s 26application/vnd.sun.xml.writer; %PREFIX -view %s 27application/vnd.sun.xml.writer.template; %PREFIX -view %s 28application/vnd.sun.xml.writer.global; %PREFIX -view %s 29application/vnd.stardivision.writer; %PREFIX -view %s 30application/vnd.stardivision.writer-global; %PREFIX -view %s 31application/x-starwriter; %PREFIX -view %s 32application/vnd.oasis.opendocument.formula; %PREFIX -view %s 33application/vnd.sun.xml.math; %PREFIX -view %s 34application/vnd.stardivision.math; %PREFIX -view %s 35application/x-starmath; %PREFIX -view %s 36application/msword; %PREFIX -view %s 37application/vnd.oasis.opendocument.spreadsheet; %PREFIX -view %s 38application/vnd.oasis.opendocument.spreadsheet-template; %PREFIX -view %s 39application/vnd.sun.xml.calc; %PREFIX -view %s 40application/vnd.sun.xml.calc.template; %PREFIX -view %s 41application/vnd.stardivision.calc; %PREFIX -view %s 42application/x-starcalc; %PREFIX -view %s 43application/vnd.stardivision.chart; %PREFIX -view %s 44application/x-starchart; %PREFIX -view %s 45application/excel; %PREFIX -view %s 46application/msexcel; %PREFIX -view %s 47application/vnd.ms-excel; %PREFIX -view %s 48application/x-msexcel; %PREFIX -view %s 49application/vnd.oasis.opendocument.presentation; %PREFIX -view %s 50application/vnd.oasis.opendocument.presentation-template; %PREFIX -view %s 51application/vnd.sun.xml.impress; %PREFIX -view %s 52application/vnd.sun.xml.impress.template; %PREFIX -view %s 53application/vnd.stardivision.impress; %PREFIX -view %s 54application/x-starimpress; %PREFIX -view %s 55application/powerpoint; %PREFIX -view %s 56application/mspowerpoint; %PREFIX -view %s 57application/vnd.ms-powerpoint; %PREFIX -view %s 58application/x-mspowerpoint; %PREFIX -view %s 59application/vnd.oasis.opendocument.graphics; %PREFIX -view %s 60application/vnd.oasis.opendocument.graphics-template; %PREFIX -view %s 61application/vnd.sun.xml.draw; %PREFIX -view %s 62application/vnd.sun.xml.draw.template; %PREFIX -view %s 63application/vnd.stardivision.draw; %PREFIX -view %s 64application/x-stardraw; %PREFIX -view %s 65application/vnd.sun.xml.base; %PREFIX -view %s 66application/vnd.oasis.opendocument.database; %PREFIX -view %s 67application/vnd.writerperfect; %PREFIX -view %s 68application/wordperfect5.1; %PREFIX -view %s 69application/x-wordperfect; %PREFIX -view %s 70application/wordperfect; %PREFIX -view %s 71application/wpwin; %PREFIX -view %s 72application/vnd.openofficeorg.extension; %PREFIX %s 73END 74else 75# backing all entries pointing to our binary 76sed '/%PREFIX/d' ${PKG_INSTALL_ROOT}/etc/mailcap 2>/dev/null 77fi 78 79