After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 123744 - nautilus misdetecting file types as application/x-sh
nautilus misdetecting file types as application/x-sh
Status: VERIFIED INCOMPLETE
Product: nautilus
Classification: Core
Component: general
2.4.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-10-03 02:13 UTC by Sean Middleditch
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4



Description Sean Middleditch 2003-10-03 02:13:40 UTC
Nautilus is always detecting files with a #!/bin/bash, #!/bin/sh, and so on
header line as being application/x-sh, even when the file suffix matches
that of another file type.  The panel run dialog does not suffer from this
problem, so my assumption is Nautilus is special casing these files versus
relying on the GNOME MIME system.

In particular, this is biting the usage of AutoPackage files - they are
technically shell scripts, but are shipped with a .package suffix, and can
be opened/used with a separate GNOME front end, meaning they don't need to
be bothered with an executable bit or the user selecting "run" instead of
"view" (which doesn't work, since the files aren't really text, and GNOME
defaults to gedit which can't handle this) - if Nautilus honoured the MIME
settings, these packages would be able to install.  Which would be uber
cool.  ^,^
Comment 1 Sebastien Bacher 2004-10-20 13:40:45 UTC
what's the mimetype expected for your .package ? The mime detection is based on
the free desktop shared-mime-info database so we need to reassign here with the
details.

Could you also join a .package file to the bug report ? The mime system need to
be filled with a detectable pattern to detect the type.
Comment 2 Sean Middleditch 2004-10-20 13:58:13 UTC
mime-type should be: application/x-autopackage


I won't attach a whole .package, they can be big - here's a link to the
AutoPackage downloads page: http://autopackage.org/downloads.html

You can install any of those by just downloading and running them once, that'll
install the AutoPackage support code.  Doing so also registers the MIME handlers
for .package files.  You can then observe how Nautilus will ignore the MIME type
(handle it as a shell script) while gnome-open will work just fine (using
gnome-vfs).

The beginning of the script looks something like:
#!/bin/bash
# autopackage 0.6
# RootName @inkscape.org/inkscape:0.39cvs
# SoftwareVersion 0.39cvs
# InterfaceVersion
# PackageVersion

Perhaps checking for "#/bin/bash\n# autopackage " at the start of the file would
work.
Comment 3 Sebastien Bacher 2004-10-20 14:22:53 UTC
I've just looked on an example (
http://ftp.sunsite.dk/projects/autopackage/0.6/foobar-1.2.3.package) there is no
 mime registration done by the .package apparently.

BTW if you want to get a mimetype supported it should be in the freedesktop
database since nautilus use it. There is no such entry for the moment so I've
reported the issue here:
http://freedesktop.org/bugzilla/show_bug.cgi?id=1677

I'm closing this bug now since that's not a nautilus bug and the problem has
been reported against shared-mime-info now. Feel free to reopen if you disagree
Comment 4 Mike Hearn 2004-10-21 16:02:05 UTC
This is fixed in autopackage upstream anyway.