summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2012-12-05 18:13:25 +0900
committerAkira TAGOH <akira@tagoh.org>2012-12-05 18:13:25 +0900
commit9231545c6bb775460702d8a615f1649bd8632f00 (patch)
treefe406080e8f68aa66ed335ee9bf86cb48e19afc8
parent2442d611579bccb84f0c29e3f9ceb0a7436df812 (diff)
Do not show the deprecation warning if it is a symlink
-rw-r--r--conf.d/50-user.conf7
-rw-r--r--configure.ac2
-rw-r--r--src/fcdir.c14
-rw-r--r--src/fcint.h3
-rw-r--r--src/fcxml.c6
5 files changed, 28 insertions, 4 deletions
diff --git a/conf.d/50-user.conf b/conf.d/50-user.conf
index 2f104089..07c9182e 100644
--- a/conf.d/50-user.conf
+++ b/conf.d/50-user.conf
@@ -1,7 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
- <!-- Load per-user customization file -->
+ <!--
+ Load per-user customization files where stored on XDG Base Directory
+ specification compliant places. it should be usually:
+ $HOME/.config/fontconfig/conf.d
+ $HOME/.config/fontconfig/fonts.conf
+ -->
<include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
<include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
<!-- the following elements will be removed in the future -->
diff --git a/configure.ac b/configure.ac
index 6d5ce7e7..5657bb5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,7 +137,7 @@ AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
-AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs])
+AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.
diff --git a/src/fcdir.c b/src/fcdir.c
index 2b476e8b..f86db190 100644
--- a/src/fcdir.c
+++ b/src/fcdir.c
@@ -35,6 +35,20 @@ FcFileIsDir (const FcChar8 *file)
return S_ISDIR(statb.st_mode);
}
+FcBool
+FcFileIsLink (const FcChar8 *file)
+{
+#if HAVE_LSTAT
+ struct stat statb;
+
+ if (lstat (file, &statb) != 0)
+ return FcFalse;
+ return S_ISLNK (statb.st_mode);
+#else
+ return FcFalse;
+#endif
+}
+
static FcBool
FcFileScanFontConfig (FcFontSet *set,
FcBlanks *blanks,
diff --git a/src/fcint.h b/src/fcint.h
index 7125f2e5..87c7b9a9 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -764,6 +764,9 @@ FcGetDefaultLang (void);
/* fcdir.c */
FcPrivate FcBool
+FcFileIsLink (const FcChar8 *file);
+
+FcPrivate FcBool
FcFileScanConfig (FcFontSet *set,
FcStrSet *dirs,
FcBlanks *blanks,
diff --git a/src/fcxml.c b/src/fcxml.c
index 5edc8674..72e9eafa 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2085,8 +2085,10 @@ FcParseInclude (FcConfigParse *parse)
FcChar8 *filename;
filename = FcConfigFilename(s);
- if ((deprecated == FcTrue) && filename)
- {
+ if (deprecated == FcTrue &&
+ filename != NULL &&
+ !FcFileIsLink (filename))
+ {
FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s);
}
if(filename)