blob: 6c540a2fd1593c8631cff305c937c4fd1549a9b1 [file] [log] [blame]
#!/bin/bash
# Copyright 1999-2004 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 $
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
echo "fixing doc symlink: ${mylink##*/}"
ln -snf "${linkto}" "${mylink}"
if [ "${y}" != "${mylink}" ] ; then
echo "removing old symlink: ${y##*/}"
rm -f "${y}"
fi
else
if [ "${y##*.}" != "gz" ] ; then
echo "gzipping doc: ${y##*/}"
gzip -f -9 "${y}"
fi
fi
done