From: Rico Tzschichholz Date: Fri, 5 May 2017 06:19:28 +0000 (+0200) Subject: vala: Don't warn about deprecated symbols if installed_version is older X-Git-Tag: 0.37.1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4c6e7620c3703927614ac4f47d052ac09f9a38c;p=thirdparty%2Fvala.git vala: Don't warn about deprecated symbols if installed_version is older --- diff --git a/vala/valaversionattribute.vala b/vala/valaversionattribute.vala index 9c3df391f..4af5da27a 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;