vm-file-editor: add override for mimeinfo *.png entry (#753)

MIME-info database contains multiple entries for *.png, namely image/png
and image/x-apple-ios-png. The later one doesn't have associated handler
program, but this one is selected by mimeopen tool.

Not sure how this tool should behave in case of multiple matches (IOW is
it a bug in File::MimeInfo perl module used by mimeopen).  Instead of
switching to different tool, which probably will break other files
(check #423), add override for this particular file type.
This commit is contained in:
Marek Marczykowski-Górecki 2013-11-14 21:38:27 +01:00
parent e17566476d
commit d72ac05dcf
4 changed files with 11 additions and 2 deletions

View File

@ -76,6 +76,8 @@ install-vm:
install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-sync-appmenus.action
install -D misc/polkit-1-qubes-allow-all.pkla $(DESTDIR)/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
install -D misc/polkit-1-qubes-allow-all.rules $(DESTDIR)/etc/polkit-1/rules.d/00-qubes-allow-all.rules
install -D -m 0644 misc/mime-globs $(DESTDIR)/usr/share/qubes/mime-override/globs
mkdir -p $(DESTDIR)/usr/lib/qubes
if [ -r misc/dispvm-dotfiles.$(DIST).tbz ] ; \

1
misc/mime-globs Normal file
View File

@ -0,0 +1 @@
image/png:*.png

View File

@ -8,6 +8,9 @@
#include <ioall.h>
#include "dvm2.h"
#define USER_HOME "/home/user"
#define MIMEINFO_DATABASES "/usr/share/mime:/usr/local/share:" USER_HOME "/.local/share:/usr/share/qubes/mime-override"
char *gettime()
{
static char retbuf[60];
@ -130,9 +133,10 @@ main()
dup2(log_fd, 1);
close(log_fd);
setenv("HOME", "/home/user", 1);
setenv("HOME", USER_HOME, 1);
setenv("DISPLAY", ":0", 1);
execl("/usr/bin/mimeopen", "mimeopen", "-n", filename, (char*)NULL);
execl("/usr/bin/mimeopen", "mimeopen", "-n",
"--database", MIMEINFO_DATABASES, filename, (char*)NULL);
perror("execl");
exit(1);
default:

View File

@ -331,6 +331,8 @@ rm -f %{name}-%{version}
/usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override
/usr/share/file-manager/actions/qvm-copy-gnome.desktop
/usr/share/file-manager/actions/qvm-dvm-gnome.desktop
%dir /usr/share/qubes
/usr/share/qubes/mime-override/globs
%dir /home_volatile
%attr(700,user,user) /home_volatile/user
%dir /mnt/removable