From: keie Date: Fri, 11 Jan 1985 16:43:56 +0000 (+0000) Subject: 1 - Allows 2 arguments, 1 - name of source in current directory. X-Git-Tag: release-5-5~5779 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=081413cfda751a94c2e4440392f47b3ab1f49ca1;p=ack.git 1 - Allows 2 arguments, 1 - name of source in current directory. 2 - name of destination file(!path), default arg 1. 2 - Make the necessary dirctory. 3 - runs ranlib if "ar t ... | grep SYMDEF succeeds. --- diff --git a/mach/install b/mach/install index 16dcaa9c3..ed04d7a0d 100755 --- a/mach/install +++ b/mach/install @@ -1,12 +1,20 @@ +case $# in +1) DEST="$1" ;; +2) DEST="$2" ;; +*) echo $0 [source] destination ;; +esac MACH=`(cd .. ; basename \`pwd\`)` -if cp $1 ../../../lib/${MACH}/$1 >/dev/null 2>&1 || - { rm -f ../../../lib/${MACH}/$1 >/dev/null 2>&1 && - cp $1 ../../../lib/${MACH}/$1 >/dev/null 2>&1 +mkdir ../../../lib/$MACH >/dev/null 2>&1 +if cp "$1" ../../../lib/${MACH}/$DEST >/dev/null 2>&1 || + { rm -f ../../../lib/${MACH}/$DEST >/dev/null 2>&1 && + cp "$1" ../../../lib/${MACH}/$DEST >/dev/null 2>&1 } then - set - - ranlib ../../../lib/${MACH}/$1 >/dev/null 2>&1 + if (ar t ../../../lib/${MACH}/$DEST | grep __.SYMDEF ) >/dev/null 2>&1 + then + ranlib ../../../lib/${MACH}/$DEST + fi exit 0 else - echo Sorry, can not create "lib/${MACH}/$1". + echo Sorry, can not create "lib/${MACH}/$DEST". fi