Skip to content
This repository
Browse code

Initial revision

git-svn-id: https://svn.r-project.org/ESS/trunk@427 0bbaf3bd-34e0-0310-bf65-c717079852d4
  • Loading branch information...
commit 172d4ef2065ee1c32298a40affaf0280f9f7dbf5 1 parent c92958e
Tony Rossini blindglobe authored

Showing 3 changed files with 287 additions and 0 deletions. Show diff stats Hide diff stats

  1. +17 0 etc/ess-sas-sh-command
  2. +238 0 install-sh
  3. +32 0 mkinstalldirs
17 etc/ess-sas-sh-command
... ... @@ -0,0 +1,17 @@
  1 +X-From-Line: rmh@fisher.stat.temple.edu Sun Oct 12 05:08:56 1997
  2 +Received: from hypatia.math.ethz.ch (hypatia.ethz.ch [129.132.58.23]) by milo.math.sc.edu (8.6.12/8.6.12) with ESMTP id FAA29018 for <rossini@stat.sc.edu>; Sun, 12 Oct 1997 05:08:55 -0400
  3 +Received: from fisher.stat.temple.edu (fisher.stat.temple.edu [155.247.29.6]) by hypatia.math.ethz.ch (8.6.12/Main-STAT-mailer) with ESMTP id LAA03914 for <ess-bugs@stat.math.ethz.ch>; Sun, 12 Oct 1997 11:08:42 +0200
  4 +Received: by fisher.stat.temple.edu (940816.SGI.8.6.9/940406.SGI.AUTO)
  5 + for ess-bugs@stat.math.ethz.ch id KAA05864; Sun, 12 Oct 1997 10:51:53 -0400
  6 +Date: Sun, 12 Oct 1997 10:51:53 -0400
  7 +From: rmh@fisher.stat.temple.edu (Richard M. Heiberger)
  8 +Message-Id: <199710121451.KAA05864@fisher.stat.temple.edu>
  9 +To: ess-bugs@stat.math.ethz.ch
  10 +Subject: ess-sas-sh-command
  11 +Lines: 3
  12 +Xref: fhat.stat.sc.edu list.ESS:350
  13 +
  14 +echo $0 $@
  15 +sas </dev/tty 1>$5 2>$6 $1 $2 $3 $4
  16 +
  17 +
238 install-sh
... ... @@ -0,0 +1,238 @@
  1 +#!/bin/sh
  2 +#
  3 +# install - install a program, script, or datafile
  4 +# This comes from X11R5.
  5 +#
  6 +# Calling this script install-sh is preferred over install.sh, to prevent
  7 +# `make' implicit rules from creating a file called install from it
  8 +# when there is no Makefile.
  9 +#
  10 +# This script is compatible with the BSD install script, but was written
  11 +# from scratch.
  12 +#
  13 +
  14 +
  15 +# set DOITPROG to echo to test this script
  16 +
  17 +# Don't use :- since 4.3BSD and earlier shells don't like it.
  18 +doit="${DOITPROG-}"
  19 +
  20 +
  21 +# put in absolute paths if you don't have them in your path; or use env. vars.
  22 +
  23 +mvprog="${MVPROG-mv}"
  24 +cpprog="${CPPROG-cp}"
  25 +chmodprog="${CHMODPROG-chmod}"
  26 +chownprog="${CHOWNPROG-chown}"
  27 +chgrpprog="${CHGRPPROG-chgrp}"
  28 +stripprog="${STRIPPROG-strip}"
  29 +rmprog="${RMPROG-rm}"
  30 +mkdirprog="${MKDIRPROG-mkdir}"
  31 +
  32 +tranformbasename=""
  33 +transform_arg=""
  34 +instcmd="$mvprog"
  35 +chmodcmd="$chmodprog 0755"
  36 +chowncmd=""
  37 +chgrpcmd=""
  38 +stripcmd=""
  39 +rmcmd="$rmprog -f"
  40 +mvcmd="$mvprog"
  41 +src=""
  42 +dst=""
  43 +dir_arg=""
  44 +
  45 +while [ x"$1" != x ]; do
  46 + case $1 in
  47 + -c) instcmd="$cpprog"
  48 + shift
  49 + continue;;
  50 +
  51 + -d) dir_arg=true
  52 + shift
  53 + continue;;
  54 +
  55 + -m) chmodcmd="$chmodprog $2"
  56 + shift
  57 + shift
  58 + continue;;
  59 +
  60 + -o) chowncmd="$chownprog $2"
  61 + shift
  62 + shift
  63 + continue;;
  64 +
  65 + -g) chgrpcmd="$chgrpprog $2"
  66 + shift
  67 + shift
  68 + continue;;
  69 +
  70 + -s) stripcmd="$stripprog"
  71 + shift
  72 + continue;;
  73 +
  74 + -t=*) transformarg=`echo $1 | sed 's/-t=//'`
  75 + shift
  76 + continue;;
  77 +
  78 + -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
  79 + shift
  80 + continue;;
  81 +
  82 + *) if [ x"$src" = x ]
  83 + then
  84 + src=$1
  85 + else
  86 + # this colon is to work around a 386BSD /bin/sh bug
  87 + :
  88 + dst=$1
  89 + fi
  90 + shift
  91 + continue;;
  92 + esac
  93 +done
  94 +
  95 +if [ x"$src" = x ]
  96 +then
  97 + echo "install: no input file specified"
  98 + exit 1
  99 +else
  100 + true
  101 +fi
  102 +
  103 +if [ x"$dir_arg" != x ]; then
  104 + dst=$src
  105 + src=""
  106 +
  107 + if [ -d $dst ]; then
  108 + instcmd=:
  109 + else
  110 + instcmd=mkdir
  111 + fi
  112 +else
  113 +
  114 +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
  115 +# might cause directories to be created, which would be especially bad
  116 +# if $src (and thus $dsttmp) contains '*'.
  117 +
  118 + if [ -f $src -o -d $src ]
  119 + then
  120 + true
  121 + else
  122 + echo "install: $src does not exist"
  123 + exit 1
  124 + fi
  125 +
  126 + if [ x"$dst" = x ]
  127 + then
  128 + echo "install: no destination specified"
  129 + exit 1
  130 + else
  131 + true
  132 + fi
  133 +
  134 +# If destination is a directory, append the input filename; if your system
  135 +# does not like double slashes in filenames, you may need to add some logic
  136 +
  137 + if [ -d $dst ]
  138 + then
  139 + dst="$dst"/`basename $src`
  140 + else
  141 + true
  142 + fi
  143 +fi
  144 +
  145 +## this sed command emulates the dirname command
  146 +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
  147 +
  148 +# Make sure that the destination directory exists.
  149 +# this part is taken from Noah Friedman's mkinstalldirs script
  150 +
  151 +# Skip lots of stat calls in the usual case.
  152 +if [ ! -d "$dstdir" ]; then
  153 +defaultIFS='
  154 +'
  155 +IFS="${IFS-${defaultIFS}}"
  156 +
  157 +oIFS="${IFS}"
  158 +# Some sh's can't handle IFS=/ for some reason.
  159 +IFS='%'
  160 +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
  161 +IFS="${oIFS}"
  162 +
  163 +pathcomp=''
  164 +
  165 +while [ $# -ne 0 ] ; do
  166 + pathcomp="${pathcomp}${1}"
  167 + shift
  168 +
  169 + if [ ! -d "${pathcomp}" ] ;
  170 + then
  171 + $mkdirprog "${pathcomp}"
  172 + else
  173 + true
  174 + fi
  175 +
  176 + pathcomp="${pathcomp}/"
  177 +done
  178 +fi
  179 +
  180 +if [ x"$dir_arg" != x ]
  181 +then
  182 + $doit $instcmd $dst &&
  183 +
  184 + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
  185 + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
  186 + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
  187 + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
  188 +else
  189 +
  190 +# If we're going to rename the final executable, determine the name now.
  191 +
  192 + if [ x"$transformarg" = x ]
  193 + then
  194 + dstfile=`basename $dst`
  195 + else
  196 + dstfile=`basename $dst $transformbasename |
  197 + sed $transformarg`$transformbasename
  198 + fi
  199 +
  200 +# don't allow the sed command to completely eliminate the filename
  201 +
  202 + if [ x"$dstfile" = x ]
  203 + then
  204 + dstfile=`basename $dst`
  205 + else
  206 + true
  207 + fi
  208 +
  209 +# Make a temp file name in the proper directory.
  210 +
  211 + dsttmp=$dstdir/#inst.$$#
  212 +
  213 +# Move or copy the file name to the temp name
  214 +
  215 + $doit $instcmd $src $dsttmp &&
  216 +
  217 + trap "rm -f ${dsttmp}" 0 &&
  218 +
  219 +# and set any options; do chmod last to preserve setuid bits
  220 +
  221 +# If any of these fail, we abort the whole thing. If we want to
  222 +# ignore errors from any of these, just make sure not to ignore
  223 +# errors from the above "$doit $instcmd $src $dsttmp" command.
  224 +
  225 + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
  226 + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
  227 + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
  228 + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
  229 +
  230 +# Now rename the file to the real destination.
  231 +
  232 + $doit $rmcmd -f $dstdir/$dstfile &&
  233 + $doit $mvcmd $dsttmp $dstdir/$dstfile
  234 +
  235 +fi &&
  236 +
  237 +
  238 +exit 0
32 mkinstalldirs
... ... @@ -0,0 +1,32 @@
  1 +#!/bin/sh
  2 +# mkinstalldirs --- make directory hierarchy
  3 +# Author: Noah Friedman <friedman@prep.ai.mit.edu>
  4 +# Created: 1993-05-16
  5 +# Last modified: 1994-03-25
  6 +# Public domain
  7 +
  8 +errstatus=0
  9 +
  10 +for file in ${1+"$@"} ; do
  11 + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
  12 + shift
  13 +
  14 + pathcomp=
  15 + for d in ${1+"$@"} ; do
  16 + pathcomp="$pathcomp$d"
  17 + case "$pathcomp" in
  18 + -* ) pathcomp=./$pathcomp ;;
  19 + esac
  20 +
  21 + if test ! -d "$pathcomp"; then
  22 + echo "mkdir $pathcomp" 1>&2
  23 + mkdir "$pathcomp" || errstatus=$?
  24 + fi
  25 +
  26 + pathcomp="$pathcomp/"
  27 + done
  28 +done
  29 +
  30 +exit $errstatus
  31 +
  32 +# mkinstalldirs ends here

0 comments on commit 172d4ef

Please sign in to comment.
Something went wrong with that request. Please try again.