GNOME Software as an xdg-app

Alexander Larsson alexl at redhat.com
Mon Feb 1 11:42:29 UTC 2016


On lör, 2016-01-30 at 14:12 +0000, Richard Hughes wrote:
> Hi all,
> 
> I spent a couple of hours packaging up gnome-software for the
> gnome-apps-nightly repo. I've attached my attempt so far, although it
> doesn't actually work yet. For gnome-software we're using libxdgapp,
> so that means building ostree (and a few other gpg things) as deps. I
> do have access to the home directory from the app so I can access
> ~/.local/share/xdg-app/ and the application desktop file. The issue I
> have is that when installed xdg-app (the command line utility
> installed in the *bundle* not the system wide version) I cannot see
> remotes and applications installed with the system xdg-app even when
> run with --user.
> 
> $ xdg-app --user list-remotes
> gnome-sdk
> $ xdg-app run --devel --command=bash org.gnome.Software
> $ ls ~/.local/share/xdg-app/app/
> /home/hughsie/.local/share/xdg-app/app/org.gimp.GimpDevelGtk3:
> $ /app/bin/xdg-app --user list-remotes
> 
> Gives me a bit fat nothing. Is there something I'm missing? GNOME
> Software of course belongs in the base image rather than a
> user-removable app, but for testing git snapshot versions alongside
> the system version (for screenshots and testing etc) this feature
> should be really useful. If we can get the per-app xdg-app working
> with the base system --user store in ~ then it'll make it easy to add
> and remove apps from the gnome-apps-nightly repo too.

Yeah, this is because whey you run the app, xdg-app will set the env
var:

 XDG_DATA_HOME="/home/rhuges/.var/app/org.gnome.Software/data"

And then xdg-app will pick this up and look for xdg-apps installed
there instead of the default ~/.local/share/.

Actually this is a problem for dconf too. If we have access to the home
directory we should be able to read the users dconf options, but
instead we look in the per-app version of that and get nothing (well
default values).

If you know what you're doing (i.e. you don't write anything else in
the XDG_DATA_HOME dir that should belong to the app) you can override
this in the gnome-software app. Its a bit problematic in general
though.

Also, at some point i made ~/.local/share/xdg-app readonly in apps, to
avoid risks with apps modifying other apps. So, either we'd have to
remove this (if you have homedir access you can do bad things anyway)
or add a way to disable it for some app.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's an underprivileged Republican boxer with a winning smile and a way 
with the ladies. She's a mentally unstable red-headed politician living 
homeless in New York's sewers. They fight crime! 





More information about the xdg-app mailing list