fix(sys-libs/ncurses): Remove terminfo from /etc w/ symlink-usr

Existing behavior remains unchanged if symlink-usr is unset, otherwise
leave terminfo alone (if minimal is also unset) or prune terminfo down
to the set that would have been installed to /etc if minimal is set.
This commit is contained in:
Michael Marineau 2013-12-11 16:06:18 -08:00
parent 6fc956aa1e
commit 2a6ef1ad8f

View File

@ -15,7 +15,7 @@ SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
LICENSE="MIT" LICENSE="MIT"
SLOT="5" SLOT="5"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
IUSE="ada +cxx debug doc gpm minimal profile static-libs tinfo trace unicode" IUSE="ada +cxx debug doc gpm minimal profile static-libs symlink-usr tinfo trace unicode"
DEPEND="gpm? ( sys-libs/gpm )" DEPEND="gpm? ( sys-libs/gpm )"
# berkdb? ( sys-libs/db )" # berkdb? ( sys-libs/db )"
@ -33,6 +33,10 @@ PDEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
S=${WORKDIR}/${MY_P} S=${WORKDIR}/${MY_P}
HOSTTIC_DIR=${WORKDIR}/${P}-host HOSTTIC_DIR=${WORKDIR}/${P}-host
MINIMAL_TERMINFO=(ansi console dumb linux rxvt rxvt-256color rxvt-unicode \
screen screen-256color sun vt{52,100,102,200,220} \
xterm xterm-color xterm-256color xterm-xfree86)
src_prepare() { src_prepare() {
[[ -n ${PV_SNAP} ]] && epatch "${WORKDIR}"/${MY_P}-${PV_SNAP}-patch.sh [[ -n ${PV_SNAP} ]] && epatch "${WORKDIR}"/${MY_P}-${PV_SNAP}-patch.sh
epatch "${FILESDIR}"/${PN}-5.8-gfbsd.patch epatch "${FILESDIR}"/${PN}-5.8-gfbsd.patch
@ -185,13 +189,10 @@ multilib_src_install() {
} }
multilib_src_install_all() { multilib_src_install_all() {
# if ! use berkdb ; then if ! use symlink-usr ; then
# We need the basic terminfo files in /etc, bug #37026 # We need the basic terminfo files in /etc, bug #37026
einfo "Installing basic terminfo files in /etc..." einfo "Installing basic terminfo files in /etc..."
for x in ansi console dumb linux rxvt rxvt-256color rxvt-unicode \ for x in "${MINIMAL_TERMINFO[@]}" ; do
screen screen-256color sun vt{52,100,102,200,220} \
xterm xterm-color xterm-256color xterm-xfree86
do
local termfile=$(find "${D}"/usr/share/terminfo/ -name "${x}" 2>/dev/null) local termfile=$(find "${D}"/usr/share/terminfo/ -name "${x}" 2>/dev/null)
local basedir=$(basename $(dirname "${termfile}")) local basedir=$(basename $(dirname "${termfile}"))
@ -202,7 +203,6 @@ multilib_src_install_all() {
/usr/share/terminfo/${basedir}/${x} /usr/share/terminfo/${basedir}/${x}
fi fi
done done
# fi
echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses
doenvd "${T}"/50ncurses doenvd "${T}"/50ncurses
@ -210,6 +210,13 @@ multilib_src_install_all() {
use minimal && rm -r "${D}"/usr/share/terminfo* use minimal && rm -r "${D}"/usr/share/terminfo*
# Because ncurses5-config --terminfo returns the directory we keep it # Because ncurses5-config --terminfo returns the directory we keep it
keepdir /usr/share/terminfo #245374 keepdir /usr/share/terminfo #245374
elif use minimal; then
# prune all files and symlinks not listed in MINIMAL_TERMINFO
find "${D}"/usr/share/terminfo ! -type d \
${MINIMAL_TERMINFO[@]/#/! -name } \
-delete || die
find "${D}"/usr/share/terminfo -type d -empty -delete || die
fi
cd "${S}" cd "${S}"
dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc