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
=== modified file 'src/Core/Client.vala'
--- src/Core/Client.vala 2016-07-02 21:54:31 +0000
+++ src/Core/Client.vala 2016-07-18 17:29:43 +0000
@@ -115,14 +115,17 @@
115 foreach (var pkg_name in package.component.get_pkgnames ()) {115 foreach (var pkg_name in package.component.get_pkgnames ()) {
116 packages_ids += pkg_name;116 packages_ids += pkg_name;
117 }117 }
118
118 packages_ids += null;119 packages_ids += null;
119120
120 try {121 try {
121 var results = yield search_task.search_names_async (Pk.Bitfield.from_enums (Pk.Filter.NEWEST, Pk.Filter.ARCH), packages_ids, cancellable, () => {});122 var results = yield search_task.resolve_async (Pk.Bitfield.from_enums (Pk.Filter.NEWEST, Pk.Filter.ARCH), packages_ids, cancellable, () => {});
122 packages_ids = {};123 packages_ids = {};
124
123 results.get_package_array ().foreach ((package) => {125 results.get_package_array ().foreach ((package) => {
124 packages_ids += package.package_id;126 packages_ids += package.package_id;
125 });127 });
128
126 packages_ids += null;129 packages_ids += null;
127130
128 results = yield install_task.install_packages_async (packages_ids, cancellable, cb);131 results = yield install_task.install_packages_async (packages_ids, cancellable, cb);
@@ -151,6 +154,7 @@
151 foreach (var pk_package in package.change_information.changes) {154 foreach (var pk_package in package.change_information.changes) {
152 packages_ids += pk_package.get_id ();155 packages_ids += pk_package.get_id ();
153 }156 }
157
154 packages_ids += null;158 packages_ids += null;
155159
156 try {160 try {
@@ -184,8 +188,7 @@
184 packages_ids += null;188 packages_ids += null;
185189
186 try {190 try {
187 var filter = Pk.Bitfield.from_enums (Pk.Filter.INSTALLED, Pk.Filter.NEWEST);191 var results = yield search_task.resolve_async (Pk.Bitfield.from_enums (Pk.Filter.INSTALLED, Pk.Filter.NEWEST), packages_ids, cancellable, () => {});
188 var results = yield search_task.search_names_async (filter, packages_ids, cancellable, () => {});
189 packages_ids = {};192 packages_ids = {};
190 results.get_package_array ().foreach ((package) => {193 results.get_package_array ().foreach ((package) => {
191 packages_ids += package.package_id;194 packages_ids += package.package_id;
192195
=== modified file 'src/Core/Task.vala'
--- src/Core/Task.vala 2016-05-31 22:33:00 +0000
+++ src/Core/Task.vala 2016-07-18 17:29:43 +0000
@@ -19,10 +19,6 @@
19 */19 */
2020
21public class AppCenter.Task : Pk.Task {21public class AppCenter.Task : Pk.Task {
22 public Task () {
23
24 }
25
26 public override void untrusted_question (uint request, Pk.Results results) {22 public override void untrusted_question (uint request, Pk.Results results) {
27 user_accepted (request);23 user_accepted (request);
28 }24 }

Subscribers

People subscribed via source and target branches