tools/update_fonts_cache.sh
author Andrzej Szeszo <aszeszo@gmail.com>
Sun, 17 Apr 2011 01:37:32 +0100
changeset 565 459f0c0bc498
parent 0 542988ea726d
permissions -rwxr-xr-x
Removed tag oi148b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     1
#!/bin/bash
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     2
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     3
# CDDL HEADER START
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     4
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").  
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     8
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     9
# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    11
# See the License for the specific language governing permissions
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    12
# and limitations under the License.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    13
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    15
# file and include the License file at src/OPENSOLARIS.LICENSE.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    19
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    20
# CDDL HEADER END
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    21
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    22
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    23
# Use is subject to license terms.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    24
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    25
# Find outdated fonts.cache-1 (due to extracting font files from
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    26
# g11n binary archives and/or from g11n source build results)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    27
# and update by executing fc-cache.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    28
# 
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    29
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    30
find /usr/openwin ! -local -prune -o -name 'fonts.cache-1' -print | while read f
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    31
do
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    32
	d=`dirname "$f"`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    33
	if [ "$d" -nt "$f" ]
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    34
	then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    35
		echo "updating $f..."
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    36
		fc-cache "$d"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    37
	fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    38
done
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    39
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    40
exit 0