Commit 01e4f088 authored by Akira TAGOH's avatar Akira TAGOH

Fix the fails of make check when SOURCE_DATE_EPOCH is set

Fixes #172
parent 8c44becd
......@@ -82,11 +82,17 @@ export FONTCONFIG_FILE
dotest "Basic check"
prep
cp $FONT1 $FONT2 $FONTDIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR
fi
check
dotest "With a subdir"
prep
cp $FONT1 $FONT2 $FONTDIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR
fi
$FCCACHE $FONTDIR
check
......@@ -94,6 +100,9 @@ dotest "Subdir with a cache file"
prep
mkdir $FONTDIR/a
cp $FONT1 $FONT2 $FONTDIR/a
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR/a
fi
$FCCACHE $FONTDIR/a
check
......@@ -104,7 +113,13 @@ mkdir $FONTDIR/a/a
mkdir $FONTDIR/b
mkdir $FONTDIR/b/a
cp $FONT1 $FONTDIR/a
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR/a
fi
cp $FONT2 $FONTDIR/b/a
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR/b/a
fi
check
dotest "Subdir with an out-of-date cache file"
......@@ -141,6 +156,9 @@ if [ x"$BWRAP" != "x" -a "x$EXEEXT" = "x" ]; then
dotest "Basic functionality with the bind-mounted cache dir"
prep
cp $FONT1 $FONT2 $FONTDIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR
fi
$FCCACHE $FONTDIR
sleep 1
ls -l $CACHEDIR > out1
......@@ -180,6 +198,9 @@ rm -rf $TESTTMPDIR out1 out2 xxx flist1 flist2 bind-fonts.conf
dotest "Different directory content between host and sandbox"
prep
cp $FONT1 $FONTDIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR
fi
$FCCACHE $FONTDIR
sleep 1
ls -1 --color=no $CACHEDIR/*cache*> out1
......@@ -187,6 +208,9 @@ stat -c '%n %s %y %z' `cat out1` > stat1
TESTTMPDIR=`mktemp -d /tmp/fontconfig.XXXXXXXX`
TESTTMP2DIR=`mktemp -d /tmp/fontconfig.XXXXXXXX`
cp $FONT2 $TESTTMP2DIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $TESTTMP2DIR
fi
sed "s!@FONTDIR@!$TESTTMPDIR/fonts</dir><dir salt="'"'"salt-to-make-different"'"'">$FONTDIR!
s!@REMAPDIR@!<remap-dir as-path="'"'"$FONTDIR"'"'">$TESTTMPDIR/fonts</remap-dir>!
s!@CACHEDIR@!$TESTTMPDIR/cache.dir!" < $TESTDIR/fonts.conf.in > bind-fonts.conf
......@@ -227,6 +251,9 @@ dotest "Check consistency of MD5 in cache name"
prep
mkdir -p $FONTDIR/sub
cp $FONT1 $FONTDIR/sub
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR/sub
fi
$FCCACHE $FONTDIR
sleep 1
(cd $CACHEDIR; ls -1 --color=no *cache*) > out1
......@@ -251,6 +278,9 @@ rm -rf $TESTTMPDIR out1 out2 bind-fonts.conf
dotest "Fallback to uuid"
prep
cp $FONT1 $FONTDIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $FONTDIR
fi
touch -d @`stat -c %Y $FONTDIR` $FONTDIR
$FCCACHE $FONTDIR
sleep 1
......@@ -291,6 +321,9 @@ mkdir -p $MyPWD/sysroot/$FONTDIR
mkdir -p $MyPWD/sysroot/$CACHEDIR
mkdir -p $MyPWD/sysroot/$MyPWD
cp $FONT1 $MyPWD/sysroot/$FONTDIR
if [ -n ${SOURCE_DATE_EPOCH:-} ]; then
touch -m -t "`date -d \"@${SOURCE_DATE_EPOCH}\" +%y%m%d%H%M.%S`" $MyPWD/sysroot/$FONTDIR
fi
cp $MyPWD/fonts.conf $MyPWD/sysroot/$MyPWD/fonts.conf
$FCCACHE -y $MyPWD/sysroot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment