From 53a8100f3c5c4a34d331e7a97680c55f5454ca19 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Mon, 2 Sep 2013 21:11:08 +0900 Subject: [PATCH] Revert the previous change and do not create a directory for migration when no old config file nor directory. (#1003495) --- fontconfig-no-dir-when-no-conf.patch | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 fontconfig-no-dir-when-no-conf.patch diff --git a/fontconfig-no-dir-when-no-conf.patch b/fontconfig-no-dir-when-no-conf.patch new file mode 100644 index 0000000..53eb6d1 --- /dev/null +++ b/fontconfig-no-dir-when-no-conf.patch @@ -0,0 +1,53 @@ +From 3e5f70a16ac6d54f1e01c92ddaa5985deec1b7f9 Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Mon, 2 Sep 2013 20:51:46 +0900 +Subject: [PATCH] Do not create a config dir for migration when no config files + nor dirs + +--- + src/fcxml.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/src/fcxml.c b/src/fcxml.c +index b464b4e..8ff10b6 100644 +--- a/src/fcxml.c ++++ b/src/fcxml.c +@@ -2233,11 +2233,6 @@ FcParseInclude (FcConfigParse *parse) + /* No config dir nor file on the XDG directory spec compliant place + * so need to guess what it is supposed to be. + */ +- FcChar8 *parent = FcStrDirname (s); +- +- if (!FcFileIsDir (parent)) +- FcMakeDirectory (parent); +- FcStrFree (parent); + if (FcStrStr (s, (const FcChar8 *)"conf.d") != NULL) + goto userdir; + else +@@ -2259,6 +2254,11 @@ FcParseInclude (FcConfigParse *parse) + { + if (FcFileIsDir (filename)) + { ++ FcChar8 *parent = FcStrDirname (userdir); ++ ++ if (!FcFileIsDir (parent)) ++ FcMakeDirectory (parent); ++ FcStrFree (parent); + if (FcFileIsDir (userdir) || + rename ((const char *)filename, (const char *)userdir) != 0 || + symlink ((const char *)userdir, (const char *)filename) != 0) +@@ -2272,6 +2272,11 @@ FcParseInclude (FcConfigParse *parse) + } + else + { ++ FcChar8 *parent = FcStrDirname (userconf); ++ ++ if (!FcFileIsDir (parent)) ++ FcMakeDirectory (parent); ++ FcStrFree (parent); + if (FcFileIsFile (userconf) || + rename ((const char *)filename, (const char *)userconf) != 0 || + symlink ((const char *)userconf, (const char *)filename) != 0) +-- +1.8.3.1 +