Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277661 - Customizing mime-type icons in $XDG_CONFIG_HOME makes Gnome-2.24 fail to start
Summary: Customizing mime-type icons in $XDG_CONFIG_HOME makes Gnome-2.24 fail to start
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gnome2.24
  Show dependency tree
 
Reported: 2009-07-13 14:46 UTC by Jianwen Wei
Modified: 2009-10-28 22:22 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jianwen Wei 2009-07-13 14:46:48 UTC
Gentoo's default MIME icon specifications for *.doc and *.pdf are so dull. These types of files' general icons are "x-office-document"(see /usr/share/mime/packages/freedesktop.org.xml). So their icons look the same and it's hard to tell them from the icons. After reading [1] and [2] (really tough work). I customize the 'PDF' mimetype icon in $XDG_CONFIG_HOME by by adding a file named 'user-type.xml' in $XDG_CONFIG_HOME/mime/packages/ (~/.local/share/mime/packages/). The content of the user-type.xml is as follows:

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/pdf">
      <icon name="x-office-spreadsheet"/>
  </mime-type>
</mime-info>

It means that I add the 'icon' property to mime-type 'application/pdf' in my own environment. Other properties about mime-type 'application/pdf' are defined in /usr/share/mime/packages/freedesktop.org.xml. Then I run 'update-mime' to generate the new XDG database files: generic-icons, globs2, icons, magic and so on. I get

application/pdf:x-office-spreadsheet

in the file 'icons'. And I think the modification on XDG database is right, but nothing happens to the PDF mime-type icon. I log off and restart Gnome, hoping this would work. As I log in, I see the Gnome splash, with brower(nautilus) and panels repeatingly initialized. I can't enter the desktop. I switch to the console, seeing the log says:

localhost nautilus segfault at 0 ip xxxx

After that, I delete user-define.xml, and rerun update-mime. Gnome become fine.

I do this in $XDG_CONFIG_HOME because I want to make the LEAST modification to the CORE SYSTEM (/usr/share/xxx). The problem seem to be that I CAN NOT CHANGE A MIME-TYPE'S ICON BY ANY WAY !!!

Later on, I modify the file '/usr/share/mime/packages/freedesktop.org.xml' directly, changing the PDF mime-type's general icon to 'x-office-spreadsheet'. Restart the box. It doesn't work.

Little about changing mimetypes' icons can be found. This is really driving me crazy.


[Reference]
[1] X Desktop Group, Shared MIME-info Database. http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
[2] X Desktop Group, Icon Theme Specification. http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
[3] MIME problem with icon spec. http://lists.freedesktop.org/archives/xdg/2009-April/010366.html

Reproducible: Always

Steps to Reproduce:
1.  Add a file named 'user-define.xml' to $XDG_CONFIG_HOME/mime/packages/ (~/.local/share/mime/packages, by default). The content is

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/pdf">
      <icon name="x-office-spreadsheet"/>
  </mime-type>
</mime-info>

2.  Restart Gnome

Actual Results:  
Stopping at the gnome splash. Users can't enter the desktop.

Expected Results:  
Enter the desktop. All the PDF files' icons should be changed to 'x-office-spreadsheet.png'.

[System]
Gentoo Linux x86 kernel-2.6.30-gentoo-r2-i686
gnome-base/gnome-light-2.24.1
x11-misc/shared-mime-info-0.60
gnome-base/gnome-mime-data-2.18.0

[emerge --info]
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r2 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r2-i686-Intel-R-_Core-TM-2_Duo_CPU_E7400_@_2.80GHz-with-glibc2.0
Timestamp of tree: Mon, 13 Jul 2009 03:20:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.5.4-r3
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://202.38.97.230/gentoo ftp://ftp.sjtu.edu.cn/gentoo http://61.135.158.199 http://mirror.averse.net/pub/gentoo http://mirro.gentoo.gr.jp"
LANG="zh_CN.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="zh_CN zh zh_TW en_US en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/gentoo-china"
SYNC="rsync://61.135.158.199/gentoo-portage"
USE="# (I 2D 3D ABL Audio CPU Compress Cosole Desktop Environment Features Graphic Hardware Library Locale Management Media Other POSIX Player Power SSL System System: Thread Window X \ a acl acpi alsa are bash-completion berkdb branding bzip2 cdr cjk cleartype cli cracklib crypt dbus don't dri dvd emacs en_US esd essential fat file fontconfig fortran gdbm gif gnome gnutls gpm gtk hal have iconv ipv6 isdnlog jfs jpeg jpeg2k latex longer midi mmx mmx2 mplayer mudflap ncurses nls no nptl nptlonly ntfs opengl openmp oss pam pcre pdf perl png pppd printer) python readline reflection session smp spell spl sse sse2 sse3 ssl ssse3 support svga sysfs system tcpd threads tiff truetype udev unicode usb x86 xfs xft xorg xscreensaver zh_CN zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LINGUAS="zh_CN zh zh_TW en_US en"
USERLAND="GNU"
VIDEO_CARDS="intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jianwen Wei 2009-07-13 14:55:06 UTC
Sorry, Steps to Reproduce should be :

1.   Add a file named 'user-define.xml' to $XDG_CONFIG_HOME/mime/packages/
(~/.local/share/mime/packages, by default). The content is

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/pdf">
      <icon name="x-office-spreadsheet"/>
  </mime-type>
</mime-info>

2. RUN update-mime 

3. Restart Gnome by logging out and logging in.
Comment 2 Gilles Dartiguelongue gentoo-dev 2009-08-11 22:23:57 UTC
this works just fine here (although it's gnome 2.26 but I don't think it makes much of a difference). What I did:

1. add you modifications to ~/.local/share/mime/packages/user-extension-fdi.xml since there was this xml lying around.
2. run update-mime-database /home/eva/.local/share/mime/ (which is not the same thing as running just update-mime-database)
3. nautilus -q ; nautilus
4. enjoy my text files showing of with a spreadsheet icon

What version of shared-mime-info do you have installed (if what I described is _exactly_ what you did) ?
Comment 3 Jianwen Wei 2009-08-14 08:30:48 UTC
Thanks for the comments. I run on the Gnome 2.24. Following your steps will reproduce EXACTLY the same bug I mentioned in the report.

1. add you modifications to ~/.local/share/mime/packages/user-extension-fdi.xml, something like:
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/pdf">
      <icon name="x-office-spreadsheet"/>
  </mime-type>
</mime-info
2. run update-mime-database ~/.local/share/mime/
3. nautilus -q ; nautilus

Guess what I get in the terminal ?
** Message: Initializing gksu extension...
Segmentation fault

Then naultilus fails to start, and all the icons on the desktop disappear...


(In reply to comment #2)
> this works just fine here (although it's gnome 2.26 but I don't think it makes
> much of a difference). What I did:
> 
> 1. add you modifications to ~/.local/share/mime/packages/user-extension-fdi.xml
> since there was this xml lying around.
> 2. run update-mime-database /home/eva/.local/share/mime/ (which is not the same
> thing as running just update-mime-database)
> 3. nautilus -q ; nautilus
> 4. enjoy my text files showing of with a spreadsheet icon
> 
> What version of shared-mime-info do you have installed (if what I described is
> _exactly_ what you did) ?
> 

Comment 4 Gilles Dartiguelongue gentoo-dev 2009-08-14 08:39:43 UTC
Not sure this is going to be much more informative but, could you provide a backtrace of the nautilus crash ? See [1] for details on how to produce a useful backtrace. Also what is your shared-mime-info version ?

[1] http://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 5 Jianwen Wei 2009-08-14 09:26:26 UTC
the shared-mime-info I use is 0.60
$ eix shared-mime-info
[I] x11-misc/shared-mime-info
     Available versions:  0.60
     Installed versions:  0.60(06:49:17 AM 07/09/2009)
     Homepage:            http://freedesktop.org/wiki/Software/shared-mime-info
     Description:

er, according to [1], producing useful backtrace require to rebuild the world with the new CFLAGS. Maybe I will have to rebuild the world for optimization of performance after the problem is setteled. An alternitave solution, or a more cost-effective solution is to udpdate Gnome to 2.26.

But, I fail to build gnome-desktop-2.26 when updating. Maybe I will report another bug report.

Anyway, thanks for your help!


[1] http://www.gentoo.org/proj/en/qa/backtraces.xml

(In reply to comment #4)
> Not sure this is going to be much more informative but, could you provide a
> backtrace of the nautilus crash ? See [1] for details on how to produce a
> useful backtrace. Also what is your shared-mime-info version ?
> 
> [1] http://www.gentoo.org/proj/en/qa/backtraces.xml
> 

Comment 6 Gilles Dartiguelongue gentoo-dev 2009-10-28 22:22:24 UTC
> But, I fail to build gnome-desktop-2.26 when updating. Maybe I will report
> another bug report.

that should be handled by the migration guide, if not, feel free to open another bug report for that.
In the meantime, closing needinfo, do not hesitate to reopen this bug once you have the requested information.