|
|
e8f856 |
From 5f12f564f8748deaa603adb7a4b8f616b6390ad4 Mon Sep 17 00:00:00 2001
|
|
|
e8f856 |
From: Keith Packard <keithp@keithp.com>
|
|
|
e8f856 |
Date: Wed, 17 Oct 2018 21:15:47 -0700
|
|
|
e8f856 |
Subject: [PATCH 1/2] Do not remove UUID file when a scanned directory is empty
|
|
|
e8f856 |
|
|
|
e8f856 |
Because FcDirCacheDeleteUUID does not reset the modification time on
|
|
|
e8f856 |
the directory, and because FcDirCacheRead unconditionally creates the
|
|
|
e8f856 |
UUID file each time it is run, any empty directory in the cache will
|
|
|
e8f856 |
get its timestamp changed each time the cache for that directory is
|
|
|
e8f856 |
read.
|
|
|
e8f856 |
|
|
|
e8f856 |
Instead, just leave the UUID file around as it is harmless.
|
|
|
e8f856 |
|
|
|
e8f856 |
The alternative would be to only create the UUID file after the cache
|
|
|
e8f856 |
has been created and the directory has been discovered to be
|
|
|
e8f856 |
non-empty, but that would delay the creation of the UUID file.
|
|
|
e8f856 |
|
|
|
e8f856 |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
e8f856 |
---
|
|
|
e8f856 |
src/fcdir.c | 7 -------
|
|
|
e8f856 |
1 file changed, 7 deletions(-)
|
|
|
e8f856 |
|
|
|
e8f856 |
diff --git a/src/fcdir.c b/src/fcdir.c
|
|
|
e8f856 |
index 93f220c..bfcdf95 100644
|
|
|
e8f856 |
--- a/src/fcdir.c
|
|
|
e8f856 |
+++ b/src/fcdir.c
|
|
|
e8f856 |
@@ -421,13 +421,6 @@ FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
|
|
|
e8f856 |
/* Not using existing cache file, construct new cache */
|
|
|
e8f856 |
if (!cache)
|
|
|
e8f856 |
cache = FcDirCacheScan (dir, config);
|
|
|
e8f856 |
- if (cache)
|
|
|
e8f856 |
- {
|
|
|
e8f856 |
- FcFontSet *fs = FcCacheSet (cache);
|
|
|
e8f856 |
-
|
|
|
e8f856 |
- if (cache->dirs_count == 0 && (!fs || fs->nfont == 0))
|
|
|
e8f856 |
- FcDirCacheDeleteUUID (dir, config);
|
|
|
e8f856 |
- }
|
|
|
e8f856 |
|
|
|
e8f856 |
return cache;
|
|
|
e8f856 |
}
|
|
|
e8f856 |
--
|
|
|
e8f856 |
2.19.1
|
|
|
e8f856 |
|
|
|
e8f856 |
From e9113a764a1001165711022aceb45aa2765feb8b Mon Sep 17 00:00:00 2001
|
|
|
e8f856 |
From: Akira TAGOH <akira@tagoh.org>
|
|
|
e8f856 |
Date: Thu, 25 Oct 2018 07:16:32 +0000
|
|
|
e8f856 |
Subject: [PATCH 2/2] Do not run a test case for .uuid deletion
|
|
|
e8f856 |
|
|
|
e8f856 |
---
|
|
|
e8f856 |
test/run-test.sh | 28 ++++++++++++++--------------
|
|
|
e8f856 |
1 file changed, 14 insertions(+), 14 deletions(-)
|
|
|
e8f856 |
|
|
|
e8f856 |
diff --git a/test/run-test.sh b/test/run-test.sh
|
|
|
e8f856 |
index e76e39b..ed41456 100644
|
|
|
e8f856 |
--- a/test/run-test.sh
|
|
|
e8f856 |
+++ b/test/run-test.sh
|
|
|
e8f856 |
@@ -239,19 +239,19 @@ fi
|
|
|
e8f856 |
|
|
|
e8f856 |
rm -rf $MyPWD/sysroot
|
|
|
e8f856 |
|
|
|
e8f856 |
-dotest "deleting .uuid file on empty dir"
|
|
|
e8f856 |
-prep
|
|
|
e8f856 |
-cp $FONT1 $FONT2 $FONTDIR
|
|
|
e8f856 |
-$FCCACHE $FONTDIR
|
|
|
e8f856 |
-sleep 1
|
|
|
e8f856 |
-rm -f $FONTDIR/*pcf
|
|
|
e8f856 |
-$FCCACHE $FONTDIR
|
|
|
e8f856 |
-rmdir $FONTDIR > /dev/null 2>&1
|
|
|
e8f856 |
-if [ $? != 0 ]; then
|
|
|
e8f856 |
- echo "*** Test failed: $TEST"
|
|
|
e8f856 |
- echo "$FONTDIR isn't empty"
|
|
|
e8f856 |
- ls -al $FONTDIR
|
|
|
e8f856 |
- exit 1
|
|
|
e8f856 |
-fi
|
|
|
e8f856 |
+# dotest "deleting .uuid file on empty dir"
|
|
|
e8f856 |
+# prep
|
|
|
e8f856 |
+# cp $FONT1 $FONT2 $FONTDIR
|
|
|
e8f856 |
+# $FCCACHE $FONTDIR
|
|
|
e8f856 |
+# sleep 1
|
|
|
e8f856 |
+# rm -f $FONTDIR/*pcf
|
|
|
e8f856 |
+# $FCCACHE $FONTDIR
|
|
|
e8f856 |
+# rmdir $FONTDIR > /dev/null 2>&1
|
|
|
e8f856 |
+# if [ $? != 0 ]; then
|
|
|
e8f856 |
+# echo "*** Test failed: $TEST"
|
|
|
e8f856 |
+# echo "$FONTDIR isn't empty"
|
|
|
e8f856 |
+# ls -al $FONTDIR
|
|
|
e8f856 |
+# exit 1
|
|
|
e8f856 |
+# fi
|
|
|
e8f856 |
|
|
|
e8f856 |
rm -rf $FONTDIR $CACHEFILE $CACHEDIR $FONTCONFIG_FILE out
|
|
|
e8f856 |
--
|
|
|
e8f856 |
2.19.1
|
|
|
e8f856 |
|