Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about apps built against EOL runtimes #1804

Closed
wants to merge 12 commits into from
Closed
6 changes: 3 additions & 3 deletions src/Core/FlatpakBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {

var added_remotes = new Gee.ArrayList<string> ();

uint deprecated_dependencies_number = 0;
bool runtime_eol = false;
meisenzahl marked this conversation as resolved.
Show resolved Hide resolved
try {
var transaction = new Flatpak.Transaction.for_installation (installation, cancellable);
transaction.add_default_dependency_sources ();
Expand Down Expand Up @@ -537,7 +537,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
var remote_ref = installation.fetch_remote_ref_sync (remote_name, kind, name, arch, branch, cancellable);

if (remote_ref.get_eol () != null || remote_ref.get_eol_rebase () != null) {
deprecated_dependencies_number++;
runtime_eol = true;
meisenzahl marked this conversation as resolved.
Show resolved Hide resolved
}
} catch (Error e) {
warning ("Error while fetching remote ref: %s", e.message);
Expand Down Expand Up @@ -576,7 +576,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
}

if (package != null) {
package.deprecated_dependencies_number = deprecated_dependencies_number;
package.runtime_eol = runtime_eol;
}

return download_size;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Package.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AppCenterCore.Package : Object {
public const string APPCENTER_PACKAGE_ORIGIN = "appcenter";
private const string ELEMENTARY_STABLE_PACKAGE_ORIGIN = "elementary-stable-focal-main";

public uint deprecated_dependencies_number { get; set; default = 0U; }
public bool runtime_eol { get; set; default = false; }

/* Note: These are just a stopgap, and are not a replacement for a more
* fleshed out parental control system. We assume any of these "moderate"
Expand Down
10 changes: 3 additions & 7 deletions src/Views/AppInfoView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -752,15 +752,11 @@ namespace AppCenter.Views {
var size = yield package.get_download_size_including_deps ();
size_label.update (size, package.is_flatpak);

if (package.deprecated_dependencies_number > 0 && !is_eol_shown) {
if (package.runtime_eol && !is_eol_shown) {
is_eol_shown = true;
var end_of_life = new ContentType (
_("End of Life"),
ngettext (
"Uses a runtime that is no longer supported and does not receive security updates",
"Uses runtimes that are no longer supported and do not receive security updates",
package.deprecated_dependencies_number
),
_("Outdated"),
_("Built with older technologies that may not work as expected or receive security updates"),
"software-update-urgent-symbolic"
);

Expand Down