Marius Tolzmann
2012-Jun-21 10:04 UTC
[Fontconfig] [PATCH 0/2] Fix deprecated user config include warning(s)..
hi.. I am new to the list and hope this is the right place to send patches to. The following patches fix an annoying warning introduced in 8c255fb185d5651b57380b0a9443001e8051b29d and included in the 2.9.91 release of fontconfig. bye marius.. Marius Tolzmann (2): Fix warning about depracted config includes if ignore_missing is true Fix newline in warning about deprecated config includes src/fcxml.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) -- 1.7.5.2
Marius Tolzmann
2012-Jun-21 10:04 UTC
[Fontconfig] [PATCH 1/2] Fix warning about depracted config includes if ignore_missing is true
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
Marius Tolzmann
2012-Jun-21 10:04 UTC
[Fontconfig] [PATCH 2/2] Fix newline in warning about deprecated config includes
--- src/fcxml.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/fcxml.c b/src/fcxml.c index 6eb089d..9ef5e36 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -2083,7 +2083,7 @@ FcParseInclude (FcConfigParse *parse) { struct stat statb; if (ignore_missing == FcFalse || FcStat(s, &statb) == 0) - FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s); + FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s); } } FcStrBufDestroy (&parse->pstack->str); -- 1.7.5.2
Marius Tolzmann
2012-Jun-21 19:01 UTC
[Fontconfig] [PATCHv2 0/3] Updated version of previous patches
hi.. please ignore the first patch series.. it won''t work as intended but at least it won''t break anything either.. 8) sorry for the noise.. this is an updated patch that also fixes the logic of deprecated config file include for the future: it assumes that if you set a config file to be deprecated, that it is ok to also set ignore_missing to true to enable the user to get rid off the warning by removing the directory in question.. It also does not use FcStat() anymore since this was not able to handle ~ home directories.. please review.. because this was the first time i looked into the sources of fontconfig 8) thx.. bye marius tolzmann... Marius Tolzmann (3): Fix newline in warning about deprecated config includes Fix warning about deprecated, non-existent config includes Assume ignore_missing on deprecated config includes src/fcxml.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) -- 1.7.5.2
Marius Tolzmann
2012-Jun-21 19:01 UTC
[Fontconfig] [PATCHv2 1/3] Fix newline in warning about deprecated config includes
--- src/fcxml.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/fcxml.c b/src/fcxml.c index b8e4469..de391d0 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -2080,7 +2080,7 @@ FcParseInclude (FcConfigParse *parse) { attr = FcConfigGetAttribute (parse, "deprecated"); if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) - FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s); + FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s); } FcStrBufDestroy (&parse->pstack->str); -- 1.7.5.2
Marius Tolzmann
2012-Jun-21 19:01 UTC
[Fontconfig] [PATCHv2 2/3] Fix warning about deprecated, non-existent config includes
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. Be polite and do not issue the warning if deprecated config includes (e.g. ~/.fonts.conf.d and/or ~/.fonts.conf) do not exist. --- src/fcxml.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/fcxml.c b/src/fcxml.c index de391d0..a146068 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -2042,6 +2042,7 @@ FcParseInclude (FcConfigParse *parse) FcChar8 *s; const FcChar8 *attr; FcBool ignore_missing = FcFalse; + FcBool deprecated = FcFalse; FcChar8 *prefix = NULL; s = FcStrBufDoneStatic (&parse->pstack->str); @@ -2053,6 +2054,9 @@ FcParseInclude (FcConfigParse *parse) attr = FcConfigGetAttribute (parse, "ignore_missing"); if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) ignore_missing = FcTrue; + attr = FcConfigGetAttribute (parse, "deprecated"); + if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) + deprecated = FcTrue; attr = FcConfigGetAttribute (parse, "prefix"); if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0) prefix = FcConfigXdgConfigHome (); @@ -2078,9 +2082,15 @@ 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.", s); + FcChar8 *filename; + + filename = FcConfigFilename(s); + if ((deprecated == FcTrue) && filename) + { + FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s); + } + if(filename) + FcStrFree(filename); } FcStrBufDestroy (&parse->pstack->str); -- 1.7.5.2
Marius Tolzmann
2012-Jun-21 19:01 UTC
[Fontconfig] [PATCHv2 3/3] Assume ignore_missing on deprecated config includes
When deprecating a config include -> force ignore_missing to be set to true. This gives the user the opportunity to fix the inclusion of deprecated config directories/files by removing them without getting error messages about missing directories. --- src/fcxml.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/fcxml.c b/src/fcxml.c index a146068..d7d917f 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -2056,7 +2056,10 @@ FcParseInclude (FcConfigParse *parse) ignore_missing = FcTrue; attr = FcConfigGetAttribute (parse, "deprecated"); if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) + { deprecated = FcTrue; + ignore_missing = FcTrue; + } attr = FcConfigGetAttribute (parse, "prefix"); if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0) prefix = FcConfigXdgConfigHome (); -- 1.7.5.2
Akira TAGOH
2012-Jun-22 05:03 UTC
[Fontconfig] [PATCHv2 0/3] Updated version of previous patches
Hi, Thanks for the patch. that indeed looks better than the previous one.> diff --git a/src/fcxml.c b/src/fcxml.c > index a146068..d7d917f 100644 > --- a/src/fcxml.c > +++ b/src/fcxml.c > @@ -2056,7 +2056,10 @@ FcParseInclude (FcConfigParse *parse) > ignore_missing = FcTrue; > attr = FcConfigGetAttribute (parse, "deprecated"); > if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) > + { > deprecated = FcTrue; > + ignore_missing = FcTrue; > + }I''m not sure how it''s useful. I don''t even see any case if users explicitly want to use the deprecated flag in their own configuration. this was added for XDG base directory specification transition and it will be dropped in the future once the enough time passed away. I''d rather encourage people to consider adding ignore_missing="yes" in their configuration if it''s the case. On Fri, Jun 22, 2012 at 4:01 AM, Marius Tolzmann <tolzmann at molgen.mpg.de> wrote:> hi.. > > please ignore the first patch series.. it won''t work as intended > but at least it won''t break anything either.. 8) > > sorry for the noise.. > > this is an updated patch that also fixes the logic of deprecated > config file include for the future: > > it assumes that if you set a config file to be deprecated, that > it is ok to also set ignore_missing to true to enable the user to > get rid off the warning by removing the directory in question.. > > It also does not use FcStat() anymore since this was not able to > handle ~ home directories.. > > please review.. because this was the first time i looked > into the sources of fontconfig 8) > > thx.. > > bye marius tolzmann... > > > Marius Tolzmann (3): > ?Fix newline in warning about deprecated config includes > ?Fix warning about deprecated, non-existent config includes > ?Assume ignore_missing on deprecated config includes > > ?src/fcxml.c | ? 19 ++++++++++++++++--- > ?1 files changed, 16 insertions(+), 3 deletions(-) > > -- > 1.7.5.2 > > _______________________________________________ > Fontconfig mailing list > Fontconfig at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/fontconfig-- Akira TAGOH
Marius Tolzmann
2012-Jun-22 08:33 UTC
[Fontconfig] [PATCHv2 0/3] Updated version of previous patches
hi.. On 06/22/12 07:03, Akira TAGOH wrote:> Thanks for the patch. that indeed looks better than the previous one.8)>> deprecated = FcTrue; >> + ignore_missing = FcTrue; > > I''m not sure how it''s useful. I don''t even see any case if users > explicitly want to use the deprecated flag in their own configuration. > this was added for XDG base directory specification transition and it > will be dropped in the future once the enough time passed away. I''d > rather encourage people to consider adding ignore_missing="yes" in > their configuration if it''s the case.Thats the reason why i have put that in an extra commit 8) It was just the idea of making it easier to avoid warnings if somebody has a use case for using the deprecated flag in the future. I will never use it 8) So it''s ok for me not having this added.. thx.. bye.. marius.. -- Dipl.-Inf. Marius Tolzmann <marius.tolzmann at molgen.mpg.de> ----------------------------------.------------------------------ MPI f. molekulare Genetik | Ihnestrasse 63-73, D-14195 Berlin | ==> MarIuX GNU/Linux <=Phone: +49 (0)30 8413 1709 | ----------------------------------^------------------------------ God put me on earth to accomplish a certain number of things. Right now I am so far behind.. ..I will never die. <by calvin from calvin&hobbes ;)> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4559 bytes Desc: S/MIME Cryptographic Signature URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120622/bcda9825/attachment-0001.bin>