summaryrefslogtreecommitdiff
path: root/Master/common.sh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-12-31 01:10:09 +0000
committerKarl Berry <karl@freefriends.org>2006-12-31 01:10:09 +0000
commita4b8041c02d131451bcb98583d62a795175ba083 (patch)
treeb9e67b9fc385099fd7c8de3cdd5897b70108ffd3 /Master/common.sh
parent28440aa9ac223b8c38974a5ccd52ae5566913923 (diff)
don't prepend '$HOME' unless the value of the
current "$HOME" was actually present. git-svn-id: svn://tug.org/texlive/trunk@3051 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/common.sh')
-rwxr-xr-xMaster/common.sh23
1 files changed, 13 insertions, 10 deletions
diff --git a/Master/common.sh b/Master/common.sh
index e123799703f..d428457eb55 100755
--- a/Master/common.sh
+++ b/Master/common.sh
@@ -339,20 +339,23 @@ TEXMFCNF__fix_texmf()
#
# the TEXMFHOME tree
if test "x$HOME_CHANGE" = "x1"; then
- # if the variable starts with the explicit home of the current user,
- # replace that with the string '$HOME' as the explicit home of the
- # current user is most certainly not what we want.
- HME=`echo "$TEXMFHOME" | sed "s@$HOME/*@@"`
- TEXMFHOME="\$HOME/$HME"
+
+ # if the variable starts with the explicit home of the current user
+ # (as in "/u/karl") replace that with the string '$HOME' as the
+ # explicit home of the current user is unlikely to ever be right.
+ if echo "$TEXMFHOME" | grep "$HOME" >/dev/null; then
+ hme=`echo "$TEXMFHOME" | sed "s,$HOME/*,,"`
+ TEXMFHOME="\$HOME/$hme"
+ fi
#
echo "Setting TEXMFHOME to $TEXMFHOME in $TEXMFCNF_DIR/texmf.cnf... " >&2
- sed "s@^TEXMFHOME.*@TEXMFHOME=$TEXMFHOME@" $TEXMFCNF_DIR/texmf.cnf \
- >.sed_tmp.$$
- cp .sed_tmp.$$ $TEXMFCNF_DIR/texmf.cnf
- rm -f .sed_tmp.$$
+ sed "s,^TEXMFHOME.*,TEXMFHOME=$TEXMFHOME," $TEXMFCNF_DIR/texmf.cnf \
+ >sedtmp.$$
+ cp sedtmp.$$ $TEXMFCNF_DIR/texmf.cnf
+ rm -f sedtmp.$$
fi
- echo Done updating texmf.cnf. >&2
+ echo "Done updating texmf.cnf." >&2
echo >&2
}