Merge lp:~donadigo/appcenter/fix-app-installation into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Merged
Merged at revision: 248
Proposed branch: lp:~donadigo/appcenter/fix-app-installation
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 55 lines (+6/-7)
2 files modified
src/Core/Client.vala (+6/-3)
src/Core/Task.vala (+0/-4)
To merge this branch: bzr merge lp:~donadigo/appcenter/fix-app-installation
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+300370@code.launchpad.net

Commit message

- Fix bug #1594070: "Cannot install Gimp using AppCenter".
- Fix installed apps would take up much more space than manually installed.

Description of the change

Fixes bug #1594070: "Cannot install Gimp using AppCenter".

This branch fixes two major issues in how AppCenter will install the packages:
1. Apps like gimp would not install due to calling search_names method which returns *all* packages that match "gimp" not the one that we are looking for.

2. Because of that also, when you would install some app in the AppCenter it would take up ridiculous sizes of disk space because of installing all packages (including docs, dev libraries, help packages).

We now call reslove_async which returns only package names that are needed in order to install specific app.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Core/Client.vala'
2--- src/Core/Client.vala 2016-07-02 21:54:31 +0000
3+++ src/Core/Client.vala 2016-07-18 17:29:43 +0000
4@@ -115,14 +115,17 @@
5 foreach (var pkg_name in package.component.get_pkgnames ()) {
6 packages_ids += pkg_name;
7 }
8+
9 packages_ids += null;
10
11 try {
12- var results = yield search_task.search_names_async (Pk.Bitfield.from_enums (Pk.Filter.NEWEST, Pk.Filter.ARCH), packages_ids, cancellable, () => {});
13+ var results = yield search_task.resolve_async (Pk.Bitfield.from_enums (Pk.Filter.NEWEST, Pk.Filter.ARCH), packages_ids, cancellable, () => {});
14 packages_ids = {};
15+
16 results.get_package_array ().foreach ((package) => {
17 packages_ids += package.package_id;
18 });
19+
20 packages_ids += null;
21
22 results = yield install_task.install_packages_async (packages_ids, cancellable, cb);
23@@ -151,6 +154,7 @@
24 foreach (var pk_package in package.change_information.changes) {
25 packages_ids += pk_package.get_id ();
26 }
27+
28 packages_ids += null;
29
30 try {
31@@ -184,8 +188,7 @@
32 packages_ids += null;
33
34 try {
35- var filter = Pk.Bitfield.from_enums (Pk.Filter.INSTALLED, Pk.Filter.NEWEST);
36- var results = yield search_task.search_names_async (filter, packages_ids, cancellable, () => {});
37+ var results = yield search_task.resolve_async (Pk.Bitfield.from_enums (Pk.Filter.INSTALLED, Pk.Filter.NEWEST), packages_ids, cancellable, () => {});
38 packages_ids = {};
39 results.get_package_array ().foreach ((package) => {
40 packages_ids += package.package_id;
41
42=== modified file 'src/Core/Task.vala'
43--- src/Core/Task.vala 2016-05-31 22:33:00 +0000
44+++ src/Core/Task.vala 2016-07-18 17:29:43 +0000
45@@ -19,10 +19,6 @@
46 */
47
48 public class AppCenter.Task : Pk.Task {
49- public Task () {
50-
51- }
52-
53 public override void untrusted_question (uint request, Pk.Results results) {
54 user_accepted (request);
55 }

Subscribers

People subscribed via source and target branches