A few misc patches

Bug #1489654 reported by Eli Schwartz on 2015-08-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

-Clean up the manual a bit.

-calibre's installed mime icons were rendered way too big in my file
browser. Scaling then down from 128x128 to 48x48 fixed this. Since it
appears to be generally accepted wisdom that icons should be installed
in multiple sizes, with 48x48 as a priority, I refactored
setup_desktop_integration to install all icons with a nice range of sizes.

- As previously mentioned (MR), when using a --staging-root for package
management, it cannot be assumed a basic filesystem layout already
exists. Most files already create the paths they need, one thing that
doesn't is the environment module. Attempt to create the python libdir
before installing it.

I didn't attempt to do the same for zsh-completion, although it looks
like *neither* completion takes into account custom locations when
installing to a staging-root. It looked like more than a quick fix, and
I didn't care *that* much. :lol:

 affects calibre

Eli Schwartz

Eli Schwartz (eschwartz) wrote :

The indentation is incorrect in the patch for icon installation as a
result no icons are being installed. Also at least on my system,
xdg-icon-resource does not resize the installed icons for you, so you
end up with the same sized icons in all folders.

Kovid Goyal (kovid) wrote :

And another thing, you have to be careful to remove --noupdate from the
last xdg-icon-resource call, otherwise the icon database is not updated.

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Eli Schwartz (eschwartz) wrote :

Hmm, would be useful to check those sizes first :o

Thank you for fixing my attempt.

Eli Schwartz (eschwartz) wrote :

Nope, it works fine in development mode, but inside a package script it results in this:

xdg-icon-resource: No writable system icon directory found.

____________________ WARNING ____________________
Setting up desktop integration failed with error:
 Traceback (most recent call last):
   File "/var/aur/calibre-git/src/calibre/src/calibre/linux.py", line 796, in setup_desktop_integration
     install_icons(iconsrc, basename, context, is_last_icon=line is icons[-1])
   File "/var/aur/calibre-git/src/calibre/src/calibre/linux.py", line 781, in install_icons
     install_single_icon(iconsrc, basename, size, context, is_last_icon and size is sizes[-1])
   File "/var/aur/calibre-git/src/calibre/src/calibre/linux.py", line 775, in install_single_icon
   File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
     raise CalledProcessError(retcode, cmd)
 CalledProcessError: Command '['xdg-icon-resource', 'install', '--noupdate', '--context', 'mimetypes', '--size', '16', 'application-lrf-16.png', 'application-lrf']' returned non-zero exit status 3

So create the directory for 16x16 icons in the package script

Eli Schwartz (eschwartz) wrote :

My bad, I get that even if I revert that patch.

xdg-icon-resource: No writable system icon directory found.

____________________ WARNING ____________________
Setting up desktop integration failed with error:
 Traceback (most recent call last):
   File "/var/aur/calibre-git/src/calibre/src/calibre/linux.py", line 770, in setup_desktop_integration
     cc('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png application-lrf', shell=True)
   File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
     raise CalledProcessError(retcode, cmd)
 CalledProcessError: Command 'xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png application-lrf' returned non-zero exit status 3

Kovid Goyal (kovid) wrote :

xdg-icon-resource requires one of the the directories in $XDG_DATA_DIRS
to exist, which defaults to /usr/local/share/:/usr/share/

Eli Schwartz (eschwartz) wrote :

Cross-posting. :p

No, it used to work just fine, as in a week or two ago, without creating those directories, and creating them does nothing either...

For some reason it just doesn't wanna put anything there. Then it proceeds to try installing them outside the staging root.

And I am positive it used to work.


Kovid Goyal (kovid) wrote :

read the source code of xdg-icon-resource IIRC its just a couple of
hundred lines of BASH

Eli Schwartz (eschwartz) wrote :

I was actually doing that -- and I *must* have been imagining things...
I have now grown immensely in my understanding of how much of a disaster xdg-utils are.

Anyway, yeah -- totally unrelated problem. And I think I have an ugly fix.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers