Re: Consistency between .uuid and cache name test

Akira TAGOH <[email protected]> Mon, 11 Mar 2019 15:36:35 +0900
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <CACT-Cx1Tpo6OKq7Kj3hw78Eq2QP=hAS1PWTvHbSiZCMqjmu5rA@mail.gmail.com>
On Sat, Mar 9, 2019 at 3:02 AM LRN <[email protected]> wrote:
>
> What is it testing for?
>
> prep #cleanup
> cp $FONT1 $FONTDIR #put 1 font into fontdir
> $FCCACHE $FONTDIR #create a cache for that fontdir
> cat $FONTDIR/.uuid #print the contents of the .uuid file (why?)
> $FCCACHE -r $FONTDIR #re-create a cache for that fontdir
> uuid=`cat $FONTDIR/.uuid` #get the contents of the .uuid file
> ls $CACHEDIR/$uuid*
> if [ $? != 0 ]; then #verify that a UUID-based cache subdir exists
>   echo "*** Test failed: $TEST"
>   echo "No cache for $uuid"
>   ls $CACHEDIR
>   exit 1
> fi
> n=`ls -1 $CACHEDIR/*cache-* | wc -l` #count the number of cache subdirs
> if [ $n != 1 ]; then #verify that only one cache subdir exists
>   echo "*** Test failed: $TEST"
>   echo "Unexpected cache was created"
>   ls $CACHEDIR
>   exit 1
> fi
>
> Why is it checking that only one cache subdir exists? The second invocation of
> fc-cache, with -r, deletes the old cache and creates a new one. I can't see why
> this test expects that only one cache will exist after this.

Because cache files are created per directories and only one directory
are available for testing. but if uuid is changed, it will be
generated with different name. this test makes sure if uuid isn't
changed by -r. though this testing should be gone soon because uuid
won't be needed.

>
> _______________________________________________
> Fontconfig mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/fontconfig



-- 
Akira TAGOH
_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig