#!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.5 2003/02/22 16:59:08 carpaski Exp $ [ ! -d "${D}"usr/share/doc/${PF} ] && exit 0 cd "${D}"usr/share/doc/${PF} find . \ \( -type f -o -type l \) \ -a -not -name '*.gz' \ -a -not -path './html/*' \ -a -not -name '.keep' \ > ${T}/prepalldocs-filelist [ `wc ${T}/prepalldocs-filelist | awk '{print $1}'` -eq 0 ] && exit 0 while read f ; do if [ -L "${f}" ] ; then # symlink ... mylink="${f}" linkto="`readlink "${f}"`" [ "${linkto##*.}" != "gz" ] && linkto="${linkto}.gz" mylink="${mylink}.gz" echo "fixing doc symlink: ${mylink##*/}" ln -snf "${linkto}" "${mylink}" if [ "${f}" != "${mylink}" ] ; then echo "removing old symlink: ${f##*/}" rm -f "${f}" fi else gzip -f -9 "${y}" fi done < ${T}/prepalldocs-filelist