From cc68d22a4a87ea77bf2ea82288854d2abcfc1f3d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 16 Jan 2006 00:03:16 +0000 Subject: from TeX git-svn-id: svn://tug.org/texlive/trunk@1480 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/selfautofix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 Build/source/selfautofix (limited to 'Build/source/selfautofix') diff --git a/Build/source/selfautofix b/Build/source/selfautofix new file mode 100755 index 00000000000..2aa08b49855 --- /dev/null +++ b/Build/source/selfautofix @@ -0,0 +1,34 @@ +#!/bin/sh + +# selfautofix: change absolute paths in texmf.cnf to $SELFAUTO references. +# Copyright: 1998, Thomas Esser. Public domain. + +bindir=$1 +web2c=$2 + +test -f "$web2c"/texmf.cnf || exit 0 +grep 'original texmf.cnf --' "$web2c"/texmf.cnf >/dev/null 2>&1 || exit 0 + +bindirp=`echo $bindir | sed 's%/[^/][^/]*$%%'` +bindirpp=`echo $bindirp | sed 's%/[^/][^/]*$%%'` + +cd $web2c || exit 0 + +sedfile=sed.$$ +test -n "$bindir" \ + && echo "/^[ ]*TEXMFCNF[ =]/!s%$bindir/%\$SELFAUTOLOC/%g" > $sedfile +test -n "$bindirp" \ + && echo "/^[ ]*TEXMFCNF[ =]/!s%$bindirp/%\$SELFAUTODIR/%g" >> $sedfile +test -n "$bindirpp" \ + && echo "/^[ ]*TEXMFCNF[ =]/!s%$bindirpp/%\$SELFAUTOPARENT/%g" >> $sedfile + +cat >>$sedfile <texmf.cnf.$$ +test -s texmf.cnf.$$ && cat texmf.cnf.$$ > texmf.cnf +rm -f texmf.cnf.$$ $sedfile + +exit 0 -- cgit v1.2.3