diff options
author | Ulrich Müller <ulm@gentoo.org> | 2009-11-14 22:00:47 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-04-02 03:57:32 +0100 |
commit | ffda6617094ae567fef31efe8de9484c1cd9673d (patch) | |
tree | 5b61d4a136dc14ff623814bb0c4635c2b9bcc5c7 | |
parent | Import 1.0 (initial commit) (diff) | |
download | eselect-fontconfig-ffda6617094ae567fef31efe8de9484c1cd9673d.tar.gz eselect-fontconfig-ffda6617094ae567fef31efe8de9484c1cd9673d.tar.bz2 eselect-fontconfig-ffda6617094ae567fef31efe8de9484c1cd9673d.zip |
Import 1.1
[sam: salvaged from CVS: https://github.com/gentoo/gentoo-historical-2/commit/117d955b5c4394cd20e43d06024a606160cbaf4c.patch]
Bug: https://bugs.gentoo.org/292104
Co-authored-by: Ryan Hill <dirtyepic@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | fontconfig.eselect | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/fontconfig.eselect b/fontconfig.eselect index ab0a10a..cb3e25a 100644 --- a/fontconfig.eselect +++ b/fontconfig.eselect @@ -1,14 +1,17 @@ -# Copyright 1999-2007 Gentoo Foundation +# -*-eselect-*- vim: ft=eselect +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-fontconfig/files/fontconfig.eselect-1.0,v 1.1 2007/07/28 02:50:13 dirtyepic Exp $ +# $Id: fontconfig.eselect 728 2009-11-14 21:08:28Z dirtyepic $ DESCRIPTION="Manage fontconfig /etc/fonts/conf.d/ symlinks" +AUTHOR="cardoe@gentoo.org" MAINTAINER="fonts@gentoo.org" -VERSION="1.0" +SVN_DATE='$Date: 2009-11-14 15:08:28 -0600 (Sat, 14 Nov 2009) $' +VERSION=$(svn_date_to_version "${SVN_DATE}") find_targets() { local targets bc x i=0 - bcdirs[i]="${ROOT}/etc/fonts/conf.avail/*.conf" + bcdirs[i]="${EROOT}/etc/fonts/conf.avail/*.conf" if [[ -n "${ES_FONTCONFIG_DIRS}" ]] ; then for x in ${ES_FONTCONFIG_DIRS} ; do @@ -24,7 +27,7 @@ find_targets() { } is_enabled() { - bcdir="${ROOT}/etc/fonts/conf.d" + bcdir="${EROOT}/etc/fonts/conf.d" [[ -e ${bcdir}/${1} ]] || return 1 return 0 @@ -37,19 +40,16 @@ describe_list() { } do_list() { - local opts + local n targets=( $(find_targets) ) - write_list_start "Available fontconfig .conf files ( $(highlight '*') is enabled ):" + write_list_start \ + "Available fontconfig .conf files ($(highlight '*') is enabled):" - if [[ -n "${targets[@]}" ]] ; then - for (( n = 0 ; n < ${#targets[@]} ; ++n )) ; do - is_enabled ${opts:-} ${targets[${n}]} && \ - targets[${n}]="${targets[${n}]} $(highlight '*')" - done - write_numbered_list "${targets[@]}" - else - write_kv_list_entry "(none found)" "" - fi + for (( n = 0; n < ${#targets[@]}; ++n )); do + is_enabled ${targets[n]} \ + && targets[n]=$(highlight_marker "${targets[n]}") + done + write_numbered_list -m "(none found)" "${targets[@]}" return 0 } @@ -69,7 +69,7 @@ describe_enable_options() { } do_enable() { - local bc bcdir="${ROOT}/etc/fonts/conf.d" + local bc bcdir="${EROOT}/etc/fonts/conf.d" [[ -z ${1} ]] && die -q "You didn't specify any .conf files to enable" @@ -104,21 +104,21 @@ do_enable() { case "${bc}" in # absolute path /*) - file="${ROOT}/${bc}" + file="${EROOT}/${bc}" ;; # relative path */*) - file="${ROOT}/${PWD}/${bc}" + file="${EROOT}/${PWD}/${bc}" ;; # no path *) # CWD if [[ -f ${bc} ]] ; then - file="${ROOT}/${PWD}/${bc}" + file="${EROOT}/${PWD}/${bc}" # assume /etc/fonts/conf.avail - elif [[ -f ${ROOT}/etc/fonts/conf.avail/${bc} ]] + elif [[ -f ${EROOT}/etc/fonts/conf.avail/${bc} ]] then - file="${ROOT}/etc/fonts/conf.avail/${bc}" + file="${EROOT}/etc/fonts/conf.avail/${bc}" else if [[ -n "${ES_FONTCONFIG_DIRS}" ]] ; then for x in ${ES_FONTCONFIG_DIRS} ; do @@ -127,7 +127,7 @@ do_enable() { fi [[ -e ${file} ]] || \ - file="${ROOT}/etc/fonts/conf.avail/${bc}" + file="${EROOT}/etc/fonts/conf.avail/${bc}" fi ;; esac @@ -166,7 +166,7 @@ describe_disable_options() { do_disable() { - local bc bcdir="${ROOT}/etc/fonts/conf.d" + local bc bcdir="${EROOT}/etc/fonts/conf.d" [[ -z ${1} ]] && die -q "You didn't specify any .conf files to disable" @@ -201,5 +201,3 @@ do_disable() { fi done } - -# vim: set ft=eselect : |