From b9d6168895181749a99d4cc17c4a595f2df6d6da Mon Sep 17 00:00:00 2001 From: Tim Vanderhoek Date: Wed, 26 May 1999 00:34:26 +0000 Subject: Don't unintentionally overwrite an existing tclsh/wish. Reported-By: Mikhail Teterin --- lang/tcl84/pkg-install.tclsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lang/tcl84') diff --git a/lang/tcl84/pkg-install.tclsh b/lang/tcl84/pkg-install.tclsh index 7133e84d294f..055957a6c36f 100644 --- a/lang/tcl84/pkg-install.tclsh +++ b/lang/tcl84/pkg-install.tclsh @@ -1,9 +1,9 @@ #!/bin/sh # The user may have a tclsh they want to preserve -if [ ! -f ${PKG_PREFIX}/bin/tclsh ] || [ \ - `grep -a awieYJFnsuILOnfsYEW ${PKG_PREFIX}/bin/tclsh | sed -e 's/.*\*\*//'` \ - -lt 001 ] +ver=`grep -a awieYJFnsuILOnfsYEW ${PKG_PREFIX}/bin/tclsh 2> /dev/null \ + | sed -e 's/.*\*\*//'` +if [ ! -e ${PKG_PREFIX}/bin/tclsh ] || [ "$ver" != "" -a "$ver" -lt 001 ] then [ -f ${PKG_PREFIX}/bin/tclsh ] && chmod u+w ${PKG_PREFIX}/bin/tclsh @@ -28,5 +28,5 @@ done ) 1>&2 exit 1 EOF - chmod a+rx ${PKG_PREFIX}/bin/tclsh + chmod 555 ${PKG_PREFIX}/bin/tclsh fi -- cgit v1.2.3