A few misc patches

Bug #1489654 reported by Eli Schwartz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

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

Revision history for this message
Eli Schwartz (eschwartz) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1489654

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.

Revision history for this message
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.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

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
Revision history for this message
Eli Schwartz (eschwartz) wrote :

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

Thank you for fixing my attempt.

Revision history for this message
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
     cc(cmd)
   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

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1489654

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

Revision history for this message
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

Revision history for this message
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/

Revision history for this message
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.

Weird.

Revision history for this message
Kovid Goyal (kovid) wrote :

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.