[vala/0.36: 16/173] vala: Don't warn about deprecated symbols if installed_version is older
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36: 16/173] vala: Don't warn about deprecated symbols if installed_version is older
- Date: Fri, 9 Feb 2018 13:55:39 +0000 (UTC)
commit 0d8f3cb7bb420a0b8c6b02bf63fe61db4e39141c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Fri May 5 08:19:28 2017 +0200
vala: Don't warn about deprecated symbols if installed_version is older
vala/valaversionattribute.vala | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaversionattribute.vala b/vala/valaversionattribute.vala
index 9c3df39..4af5da2 100644
--- a/vala/valaversionattribute.vala
+++ b/vala/valaversionattribute.vala
@@ -150,7 +150,9 @@ public class Vala.VersionAttribute {
// deprecation:
if (symbol.external_package && deprecated) {
- if (!CodeContext.get ().deprecated) {
+ string? package_version = symbol.source_reference.file.installed_version;
+
+ if (!CodeContext.get ().deprecated && (package_version == null || deprecated_since ==
null || VersionAttribute.cmp_versions (package_version, deprecated_since) >= 0)) {
Report.deprecated (source_ref, "%s %s%s".printf (symbol.get_full_name (),
(deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since),
(replacement == null) ? "" : ". Use %s".printf (replacement)));
}
result = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]