[PATCH 1/2] Fix warning about depracted config includes if ignore_missing is true

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 8: reading configurations from ~/.fonts.conf.d is deprecated.

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.

Since ignore_missing="yes" is set in the config file it may be polite
to not issue the warning if ~/.fonts.conf.d and/or ~/.fonts.conf do
not exist.
---
 src/fcxml.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/fcxml.c b/src/fcxml.c
index b8e4469..6eb089d 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2078,9 +2078,13 @@ FcParseInclude (FcConfigParse *parse)
 	parse->error = FcTrue;
     else
     {
-	attr = FcConfigGetAttribute (parse, "deprecated");
-	if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
-	    FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s);
+        attr = FcConfigGetAttribute (parse, "deprecated");
+        if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
+        {
+            struct stat statb;
+            if (ignore_missing == FcFalse || FcStat(s, &statb) == 0)
+                FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s);
+        }
     }
     FcStrBufDestroy (&parse->pstack->str);
 
-- 
1.7.5.2

_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig


[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux