FS#6801 - jre breaks my /etc/mailcap and mime.types file
Attached to Project:
Arch Linux
Opened by Nagy Gabor (combo) - Tuesday, 03 April 2007, 21:35 GMT
Last edited by Paul Mattal (paul) - Saturday, 12 January 2008, 03:48 GMT
Opened by Nagy Gabor (combo) - Tuesday, 03 April 2007, 21:35 GMT
Last edited by Paul Mattal (paul) - Saturday, 12 January 2008, 03:48 GMT
|
Details
There is a bug post_install of jre (and similar)
packages:
--------------------- mailcap=$(grep -v 'application/x-java-jnlp-file' /etc/mailcap) echo $mailcap >/etc/mailcap --------------------- This will delete the \n characters from the file making it unusable. And the same for mime.types |
This task depends upon
Closed by Paul Mattal (paul)
Saturday, 12 January 2008, 03:48 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in jre 6u3-2.
Saturday, 12 January 2008, 03:48 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in jre 6u3-2.
sed -e '/application\/x-java-jnlp-file/d' -i /etc/mailcap
would be better than this grep action. Other option is using a tempfile which is created by piping through grep -v, I would prefer the sed method, as it's cleaner.
But more productively, Dan can we really just get rid of the touching of mime.types entirely, or are we going to need to find a safer way to do this?
If so, let me know and I will.
Feel free to try Paul.
1) We can just never touch mime-types.
2) Jan's solution above seems safe for mailcap and addresses the \n issues.
So does this attached jre.install seem to everyone like it would solve the problems? If so, I'll go ahead and test/deploy it. But I didn't want to go any further without being sure I understood the issues-- this seems a little too simple to me to be the answer.
1) first installation of jre and no /etc/mailcap in the system;
2) upgrade of jre and no /etc/mailcap;
3) first installation and existing /etc/mailcap;
4) upgrade and existing /etc/mailcap.
In all the four scenarios, it seems to do the right thing. So, when there is no /etc/mailcap, a single line /etc/mailcap is created with:
application/x-java-jnlp-file;/opt/java/jre/bin/javaws %s
When /etc/mailcap exists, this line is added at the end of the file, without damaging the rest of the file; also the \n are untouched.
Obviously also /etc/mime.types is now not damaged.
It seems to me that this simple solution works fine.