build/autoconf/install-sh

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #!/bin/sh
     2 # This Source Code Form is subject to the terms of the Mozilla Public
     3 # License, v. 2.0. If a copy of the MPL was not distributed with this
     4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7 #
     8 # install - install a program, script, or datafile
     9 # This comes from X11R5; it is not part of GNU.
    10 #
    11 # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
    12 #
    13 # This script is compatible with the BSD install script, but was written
    14 # from scratch.
    15 #
    18 # set DOITPROG to echo to test this script
    20 # Don't use :- since 4.3BSD and earlier shells don't like it.
    21 doit="${DOITPROG-}"
    24 # put in absolute paths if you don't have them in your path; or use env. vars.
    26 mvprog="${MVPROG-mv}"
    27 cpprog="${CPPROG-cp}"
    28 chmodprog="${CHMODPROG-chmod}"
    29 chownprog="${CHOWNPROG-chown}"
    30 chgrpprog="${CHGRPPROG-chgrp}"
    31 stripprog="${STRIPPROG-strip}"
    32 rmprog="${RMPROG-rm}"
    34 instcmd="$mvprog"
    35 chmodcmd=""
    36 chowncmd=""
    37 chgrpcmd=""
    38 stripcmd=""
    39 rmcmd="$rmprog -f"
    40 mvcmd="$mvprog"
    41 src=""
    42 dst=""
    44 while [ x"$1" != x ]; do
    45     case $1 in
    46 	-c) instcmd="$cpprog"
    47 	    shift
    48 	    continue;;
    50 	-m) chmodcmd="$chmodprog $2"
    51 	    shift
    52 	    shift
    53 	    continue;;
    55 	-o) chowncmd="$chownprog $2"
    56 	    shift
    57 	    shift
    58 	    continue;;
    60 	-g) chgrpcmd="$chgrpprog $2"
    61 	    shift
    62 	    shift
    63 	    continue;;
    65 	-s) stripcmd="$stripprog"
    66 	    shift
    67 	    continue;;
    69 	*)  if [ x"$src" = x ]
    70 	    then
    71 		src=$1
    72 	    else
    73 		dst=$1
    74 	    fi
    75 	    shift
    76 	    continue;;
    77     esac
    78 done
    80 if [ x"$src" = x ]
    81 then
    82 	echo "install:  no input file specified"
    83 	exit 1
    84 fi
    86 if [ x"$dst" = x ]
    87 then
    88 	echo "install:  no destination specified"
    89 	exit 1
    90 fi
    93 # If destination is a directory, append the input filename; if your system
    94 # does not like double slashes in filenames, you may need to add some logic
    96 if [ -d $dst ]
    97 then
    98 	dst="$dst"/`basename $src`
    99 fi
   101 # Make a temp file name in the proper directory.
   103 dstdir=`dirname $dst`
   104 dsttmp=$dstdir/#inst.$$#
   106 # Move or copy the file name to the temp name
   108 $doit $instcmd $src $dsttmp
   110 # and set any options; do chmod last to preserve setuid bits
   112 if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
   113 if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
   114 if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
   115 if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
   117 # Now rename the file to the real destination.
   119 $doit $rmcmd $dst
   120 $doit $mvcmd $dsttmp $dst
   123 exit 0

mercurial