summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-08-28 08:37:44 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-08-28 08:37:44 +0000
commitd9fc4acc572c6647a4f27b838d35d27d805d190e (patch)
tree262a8de35d8c7567312757da5f1f66efdc8cece5 /bin/prepinfo
downloadportage-multirepo-d9fc4acc572c6647a4f27b838d35d27d805d190e.tar.gz
portage-multirepo-d9fc4acc572c6647a4f27b838d35d27d805d190e.tar.bz2
portage-multirepo-d9fc4acc572c6647a4f27b838d35d27d805d190e.zip
Migration (without history) of the current stable line to subversion.
svn path=/main/branches/2.0/; revision=1941
Diffstat (limited to 'bin/prepinfo')
-rwxr-xr-xbin/prepinfo45
1 files changed, 45 insertions, 0 deletions
diff --git a/bin/prepinfo b/bin/prepinfo
new file mode 100755
index 00000000..65bfba32
--- /dev/null
+++ b/bin/prepinfo
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-src/portage/bin/prepinfo,v 1.6.2.1 2005/05/29 12:40:08 jstubbs Exp $
+
+if [ -z "$1" ] ; then
+ z="${D}usr/share/info"
+else
+ if [ -d "${D}$1/share/info" ] ; then
+ z="${D}$1/share/info"
+ else
+ z="${D}$1/info"
+ fi
+fi
+
+[ ! -d "${z}" ] && exit 0
+
+rm -f "${z}"/{dir,dir.info,dir.info.gz}
+
+for x in `find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev/null` ; do
+ if [ -L "${x}" ] ; then
+ # Symlink ...
+ mylink="${x}"
+ linkto="`readlink "${x}"`"
+
+ if [ "${linkto##*.}" != "gz" ] ; then
+ linkto="${linkto}.gz"
+ fi
+ if [ "${mylink##*.}" != "gz" ] ; then
+ mylink="${mylink}.gz"
+ fi
+
+ echo "fixing GNU info symlink: ${mylink##*/}"
+ ln -snf "${linkto}" "${mylink}"
+ if [ "${x}" != "${mylink}" ] ; then
+ echo "removing old symlink: ${x##*/}"
+ rm -f "${x}"
+ fi
+ else
+ if [ "${x##*.}" != "gz" ] ; then
+ echo "gzipping GNU info page: ${x##*/}"
+ gzip -f -9 "${x}"
+ fi
+ fi
+done