After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707728 - More general bug fixes
More general bug fixes
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-08 16:14 UTC by Giovanni Campagna
Modified: 2013-10-12 20:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
appstream: add support for translations (13.81 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
reviewed Details | Review
datadir-apps: use localized variants of Name and Comment (1.63 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
accepted-commit_now Details | Review
Fix plugin priorities (2.37 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
none Details | Review
packagekit-refine: don't override the state if already known (1.90 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
committed Details | Review
AppWidget: don't allow removing applications installed through jhbuild (2.95 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
none Details | Review
Fix the priority of the hardcoded-refine plugins (2.29 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
none Details | Review
datadir-apps: ignore ENOENT reading the .desktop filename (1.24 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
committed Details | Review
ShellDetails: allow removing an application that can be updated (1.30 KB, patch)
2013-09-08 16:14 UTC, Giovanni Campagna
none Details | Review
packagekit: don't try to remove applications that were not installed as packages (2.71 KB, patch)
2013-09-08 16:15 UTC, Giovanni Campagna
none Details | Review
Add a jhbuild plugin (7.60 KB, patch)
2013-09-08 16:15 UTC, Giovanni Campagna
none Details | Review
appstream: add support for translations (10.18 KB, patch)
2013-09-09 14:29 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-09-08 16:14:16 UTC
This started as "support translated stuff in appstream", and ended
up in another round of miscellanous fixes.
I believe the two about plugin priorities are particularly important,
and probably Richard should give a look at them personally.

The jhbuild plugin is just an experiment in having an other
application backend. It works for removing (not yet installing or
updating, since it's not clear if we should "build" or "buildone"),
but it is terribly slow, because it forks to jhbuild for every package.
It's not really for merging in master.
Comment 1 Giovanni Campagna 2013-09-08 16:14:19 UTC
Created attachment 254410 [details] [review]
appstream: add support for translations

Recognize xml:lang tags in the appstream files and use them to
provide translated names, summaries and descriptions.
Comment 2 Giovanni Campagna 2013-09-08 16:14:27 UTC
Created attachment 254411 [details] [review]
datadir-apps: use localized variants of Name and Comment

This way the translated names are shown for installed apps, even
if the appstream data does not provide translations.
Comment 3 Giovanni Campagna 2013-09-08 16:14:33 UTC
Created attachment 254412 [details] [review]
Fix plugin priorities

We want to run appstream first, so we can translate package-names
to app ids and viceversa. We want to run datadir-filename before desktopdb
(so the .desktop files matches the one seen by the shell, in case of
local overrides to system packages), and we want to run datadir-apps
after datadir-filename and desktopdb (so the .desktop file name is
already known). Note that desktopdb becomes effectively superflous
in presence of appstream data.
Also, datadir-filename must not check for the app name (since it
runs after appstream now). It shouldn't anyway, the purpose of this
plugin is to se the .desktop filename.
Comment 4 Giovanni Campagna 2013-09-08 16:14:42 UTC
Created attachment 254413 [details] [review]
packagekit-refine: don't override the state if already known

The flow is like this: the GsShell calls get_popular(),
hardcoded-popular replies with a list of GsApps without metadata.
For each app, datadir-filename finds the .desktop file, in this
case in a jhbuild directory; datadir-filename-local notes that
the app is not from /usr, and marks it installed. appstream
also knows about the app, and sets a package-name.
Finally, packagekit-refine sees the app does not have a package-id
(because it didn't originate from packagekit), so it searches
for one. At that point, it would set the installed status
according to the package, but that's wrong, because the app
is installed locally.
Comment 5 Giovanni Campagna 2013-09-08 16:14:45 UTC
Created attachment 254414 [details] [review]
AppWidget: don't allow removing applications installed through jhbuild

If the install-kind is local, assume that no plugin is capable of
removing the app and make the widget insensitive.
Note that before removing was actually possible, as packagekit-refine
would set a package-id even on locally installed applications
(and then packagekit would not check the install-kind)
Comment 6 Giovanni Campagna 2013-09-08 16:14:50 UTC
Created attachment 254415 [details] [review]
Fix the priority of the hardcoded-refine plugins

We need to run these after appstream (to get the package-name
to app ID conversion) and after datadir-apps (to override the
kind set there). This mostly affects hardcoded-kind, but
I changed the other for consistency too.
Note that if we ever have real plugins for this data, we may
have to revisit this.
Comment 7 Giovanni Campagna 2013-09-08 16:14:53 UTC
Created attachment 254416 [details] [review]
datadir-apps: ignore ENOENT reading the .desktop filename

The desktopdb plugin can sometimes give us a non existing .desktop (for
example if the cache was not regenerated after uninstalling the
app), spare the warning in that case.
Comment 8 Giovanni Campagna 2013-09-08 16:14:57 UTC
Created attachment 254417 [details] [review]
ShellDetails: allow removing an application that can be updated

There is not reason not to allow that.
Comment 9 Giovanni Campagna 2013-09-08 16:15:01 UTC
Created attachment 254418 [details] [review]
packagekit: don't try to remove applications that were not installed as packages

Fail with NOT_SUPPORTED is install-kind != package, and let the
other plugins handle it.
Also, make sure that packagekit-refine also sets install-kind == package,
to remove featured and popular apps.
Comment 10 Giovanni Campagna 2013-09-08 16:15:06 UTC
Created attachment 254419 [details] [review]
Add a jhbuild plugin

Allows showing information (version, mostly) for jhbuilt applications,
and removing them.
Comment 11 Matthias Clasen 2013-09-08 19:00:44 UTC
Review of attachment 254410 [details] [review]:

::: src/plugins/appstream-app.c
@@ +104,3 @@
+	app->names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+	app->summaries = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+	app->descriptions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);

Do we really need to keep tables of translations ? I would expect us to just keep the 'best' locale around
Comment 12 Matthias Clasen 2013-09-08 19:03:29 UTC
Review of attachment 254411 [details] [review]:

sure
Comment 13 Giovanni Campagna 2013-09-08 19:05:53 UTC
(In reply to comment #11)
> Review of attachment 254410 [details] [review]:
> 
> ::: src/plugins/appstream-app.c
> @@ +104,3 @@
> +    app->names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
> g_free);
> +    app->summaries = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
> g_free);
> +    app->descriptions = g_hash_table_new_full (g_str_hash, g_str_equal,
> g_free, g_free);
> 
> Do we really need to keep tables of translations ? I would expect us to just
> keep the 'best' locale around

Yeah, but we don't know the best locale until we read all of them
Comment 14 Matthias Clasen 2013-09-08 19:05:59 UTC
Review of attachment 254416 [details] [review]:

makes sense
Comment 15 Matthias Clasen 2013-09-08 19:15:21 UTC
Review of attachment 254417 [details] [review]:

I think this needs some clarifications on how the various GsApp states and kinds are defined and how they interact. I've been asking for this for a while...
Comment 16 Matthias Clasen 2013-09-08 19:17:40 UTC
Review of attachment 254419 [details] [review]:

Frankly, I don't think jhbuild makes sense in this application. It is a distraction from what gnome-software is about, and muddies the waters when we haven't even gotten package-based applications fully done yet...
Comment 17 Giovanni Campagna 2013-09-09 14:29:39 UTC
Created attachment 254489 [details] [review]
appstream: add support for translations

Recognize xml:lang tags in the appstream files and use them to
provide translated names, summaries and descriptions.
Comment 18 Richard Hughes 2013-09-09 15:11:59 UTC
(In reply to comment #17)
> Recognize xml:lang tags in the appstream files and use them to
> provide translated names, summaries and descriptions.

This patch only, fixed up and merged, thanks!
Comment 19 Richard Hughes 2013-10-12 20:16:30 UTC
I think we've got all the important bits from this patch, so I'll close it now. Thanks!