blob: d8b8b747328bd2e6e0b64ef66b74d7c92843f271 [file] [log] [blame]
#!/bin/bash
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.6 2004/10/04 13:56:50 vapier Exp $
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
z="$(find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null)"
for y in ${z} ; do
if [ -L "${y}" ] ; then
# Symlink ...
mylink="${y}"
linkto="$(readlink "${y}")"
if [ "${linkto##*.}" != "gz" ] ; then
linkto="${linkto}.gz"
fi
if [ "${mylink##*.}" != "gz" ] ; then
mylink="${mylink}.gz"
fi
vecho "fixing doc symlink: ${mylink##*/}"
ln -snf "${linkto}" "${mylink}"
if [ "${y}" != "${mylink}" ] ; then
vecho "removing old symlink: ${y##*/}"
rm -f "${y}"
fi
else
if [ "${y##*.}" != "gz" ] ; then
vecho "gzipping doc: ${y##*/}"
gzip -f -9 "${y}"
fi
fi
done