Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#7915 - /etc/mime.types lacks linefeeds

Attached to Project: Arch Linux
Opened by Antons Šušpans (antox) - Thursday, 30 August 2007, 21:21 GMT
Last edited by Greg (dolby) - Tuesday, 17 June 2008, 10:49 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To Jason Chu (jason)
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08 Don't Panic
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
/etc/mime.types lacks linefeeds, therefore is not usable.

Additional info:
* package version(s): mime-types 1.0-1

Steps to reproduce:
less /etc/mime.types
This task depends upon

Closed by  Greg (dolby)
Tuesday, 17 June 2008, 10:49 GMT
Reason for closing:  Fixed
Comment by Jens Adam (byte) - Friday, 31 August 2007, 03:56 GMT
To which package does your /etc/mime.types belong? -- 'pacman -Qo /etc/mime.types'
If that doesn't help, run 'find /var/lib/pacman/local/ -name install | xargs grep -l mime.types' and have a closer look at the results.
Comment by Jens Adam (byte) - Friday, 31 August 2007, 04:00 GMT
Eh, okay, there's a mime-types package now. I'll read more closely next time... ;-)
Nevertheless, the file looks fine here, so maybe the find run from above might still prove useful.
Comment by Antons Šušpans (antox) - Friday, 31 August 2007, 13:02 GMT
Yes, you are right. My reasoning was hollow. (And I wasn't aware of how pacman treats the config file versions.)
There is a normal "mime.types" file in "mime-types" package. But grepping (that you suggested) discovered, that the file "/etc/mime.types" gets corrupted during the installation of "jre" since "/var/lib/pacman/local/jre-6u2-1/install" has the following:
if [ -f /etc/mime.types ] ; then
mime=$(grep -v 'application/x-java-jnlp-file' /etc/mime.types)
echo $mime>/etc/mime.types
fi
echo 'application/x-java-jnlp-file jnlp' >>/etc/mime.types

I am not an experienced linux user and I don't know whether:
$ a=`echo -e "1\n2"`; echo $a
1 2
is the right behavior.

However, I'd suggest to replace that chunk of code with:
grep -qs 'application/x-java-jnlp-file' /etc/mime.types || echo 'application/x-java-jnlp-file jnlp' >> /etc/mime.types
and also something sensible for post_remove,
BUT is the "/etc/mime.types" file expected to be modified by package installers?
Comment by Giorgio Lando (patroclo7) - Friday, 21 December 2007, 10:12 GMT
I think that this is a duplicate of the highly annoying 6801 and that the comment by Antox includes a possible solution.

Loading...