Drop cleanup_fonts from xorg eclasses as it's now handled by font.eclass. (bug #315369)
authorRyan Hill <rhill@gentoo.org>
Sun, 4 Jul 2010 20:42:22 +0000 (20:42 +0000)
committerRyan Hill <rhill@gentoo.org>
Sun, 4 Jul 2010 20:42:22 +0000 (20:42 +0000)
eclass/x-modular.eclass
eclass/xorg-2.eclass

index b7ba3f0c49f999061bf3ff51454f0eb3707ebafd..e404d332e92c32c1cffc543b775aa8f7d69266d5 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.118 2009/12/09 10:21:49 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.119 2010/07/04 20:42:22 dirtyepic Exp $
 #
 # @ECLASS: x-modular.eclass
 # @MAINTAINER:
@@ -498,50 +498,10 @@ x-modular_pkg_postinst() {
 # task right now is some cleanup for font packages.
 x-modular_pkg_postrm() {
        if [[ -n "${FONT}" ]]; then
-               cleanup_fonts
                font_pkg_postrm
        fi
 }
 
-# @FUNCTION: cleanup_fonts
-# @USAGE:
-# @DESCRIPTION:
-# Get rid of font directories that only contain generated files
-cleanup_fonts() {
-       local ALLOWED_FILES="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
-       for DIR in ${FONT_DIR}; do
-               unset KEEP_FONTDIR
-               REAL_DIR=${ROOT}usr/share/fonts/${DIR}
-
-               ebegin "Checking ${REAL_DIR} for useless files"
-               pushd ${REAL_DIR} &> /dev/null
-               for FILE in *; do
-                       unset MATCH
-                       for ALLOWED_FILE in ${ALLOWED_FILES}; do
-                               if [[ ${FILE} = ${ALLOWED_FILE} ]]; then
-                                       # If it's allowed, then move on to the next file
-                                       MATCH="yes"
-                                       break
-                               fi
-                       done
-                       # If we found a match in allowed files, move on to the next file
-                       if [[ -n ${MATCH} ]]; then
-                               continue
-                       fi
-                       # If we get this far, there wasn't a match in the allowed files
-                       KEEP_FONTDIR="yes"
-                       # We don't need to check more files if we're already keeping it
-                       break
-               done
-               popd &> /dev/null
-               # If there are no files worth keeping, then get rid of the dir
-               if [[ -z "${KEEP_FONTDIR}" ]]; then
-                       rm -rf ${REAL_DIR}
-               fi
-               eend 0
-       done
-}
-
 # @FUNCTION: setup_fonts
 # @USAGE:
 # @DESCRIPTION:
index bea3ef8f6059ab7f13852c3132858be88879feb6..a8918d6d9714dbe40474f9b293344ef374cab08a 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.4 2010/06/08 20:22:12 remi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.5 2010/07/04 20:42:22 dirtyepic Exp $
 #
 # @ECLASS: xorg-2.eclass
 # @MAINTAINER:
@@ -357,45 +357,10 @@ xorg-2_pkg_postinst() {
 # task right now is some cleanup for font packages.
 xorg-2_pkg_postrm() {
        if [[ -n ${FONT} ]]; then
-               cleanup_fonts
                font_pkg_postrm
        fi
 }
 
-# @FUNCTION: cleanup_fonts
-# @USAGE:
-# @DESCRIPTION:
-# Get rid of font directories that only contain generated files
-cleanup_fonts() {
-       local allowed_files="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
-       local real_dir=${EROOT}usr/share/fonts/${FONT_DIR}
-       local fle allowed_file
-
-       unset KEEP_FONTDIR
-
-       einfo "Checking ${real_dir} for useless files"
-       pushd ${real_dir} &> /dev/null
-       for fle in *; do
-               unset MATCH
-               for allowed_file in ${allowed_files}; do
-                       if [[ ${fle} = ${allowed_file} ]]; then
-                               # If it's allowed, then move on to the next file
-                               MATCH="yes"
-                               break
-                       fi
-               done
-               # If we found a match in allowed files, move on to the next file
-               [[ -n ${MATCH} ]] && continue
-               # If we get this far, there wasn't a match in the allowed files
-               KEEP_FONTDIR="yes"
-               # We don't need to check more files if we're already keeping it
-               break
-       done
-       popd &> /dev/null
-       # If there are no files worth keeping, then get rid of the dir
-       [[ -z "${KEEP_FONTDIR}" ]] && rm -rf ${real_dir}
-}
-
 # @FUNCTION: setup_fonts
 # @USAGE:
 # @DESCRIPTION: