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 141901 - gnome_vfs_get_mime_type does not return the correct mime type.
gnome_vfs_get_mime_type does not return the correct mime type.
Status: RESOLVED NOTABUG
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
cvs (head)
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-05 12:12 UTC by Muktha
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (798 bytes, patch)
2004-05-05 12:29 UTC, Muktha
none Details | Review

Description Muktha 2004-05-05 12:12:27 UTC
If gnome is installed in any path other than /usr then gnome_vfs_get_mime_type
will not fetch the correct mime type of the specified file.
Comment 1 Muktha 2004-05-05 12:29:16 UTC
Created attachment 27389 [details] [review]
Proposed patch
Comment 2 Christophe Fergeau 2004-05-05 12:32:08 UTC
I believe this is done on purpose to follow the freedesktop base dir spec
(http://freedesktop.org/Standards/basedir-spec/basedir-spec-0.6.html). You need
to set the XDG_DATA_DIRS env variable to get things working properly. jrb, can
you confirm/infirm ?
Comment 3 Muktha 2004-05-06 05:44:26 UTC
This problem is seen in many applications like yelp, nautilus etc when Gnome is
installed in non-standard location (e.g. /opt/gnome).
 
Is 'each' application required to explicitly set the env variable before getting
the mime type from gnome-vfs?

ps: Setting the env variable can't be done at session-level, as user can run an
app from remote display.
Comment 4 Christophe Fergeau 2004-05-06 08:12:19 UTC
It's not up to each app, it's up to the user/sysadmin to properly set up the
user environment. If gnome isn't installed in a standard location, you need to
set LD_LIBRARY_PATH (or run ldconfig at some point), PKG_CONFIG_PATH,
ACLOCAL_FLAGS, ... if you want things to work perfectly, this is the same with
XDG_DATA_DIRS.
Comment 5 Laszlo (Laca) Peter 2004-05-07 05:35:52 UTC
I think there's a disconnect here.

Muktha is talking about building GNOME with a $prefix that is not /usr but
something else, not relocating the binaries/config files that were build
with a different prefix.

In this case, you don't need to set LD_LIBRARY_PATH or PKG_CONFIG_PATH.
(pkg-config also defaults to $libdir/pkgconfig)

The spec you point to says:

"- Such file should be installed to $datadir/subdir/filename with $datadir 
   defaulting to /usr/share"

In our case $datadir is not /usr/share and the file we wish to reference
is in $datadir/subdir/filename.

I'd even say that DATADIR should be searched first, then /usr/share and
finally /usr/local/share.
Comment 6 Christophe Fergeau 2004-05-07 07:46:18 UTC
I think the spec is pretty clear about that:

« If $XDG_DATA_DIRS is either not set or empty, a value equal to
/usr/local/share/:/usr/share/ should be used.
[...]
 Lookups of the data file should search for ./subdir/filename relative to all
base directories specified by $XDG_DATA_HOME and $XDG_DATA_DIRS . If an
environment variable is either not set or empty, its default value as defined by
this specification should be used instead.
»

If you think this is wrong, you should bring the issue up on one of the
freedesktop mailing lists. I think the rationale for not taking account
installation prefix at all is to make it desktop agnostic, ie if someone
installs kde in /opt/kde and gnome in /opt/gnome, then they both look for the
files they need in the same place.
Comment 7 William Jon McCann 2004-05-10 15:23:37 UTC
This seems like a dup of bug 132338.