]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - install-sh
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / install-sh
index be1adf563285169065ede971f2d1a71ea2299f1c..bcd89dacb2dd088a7a427d69e3336409de8eeb50 100755 (executable)
@@ -1,10 +1,8 @@
 #!/bin/sh
 #
-# "$Id$"
-#
 # Install a program, script, or datafile.
 #
-# Copyright 2008-2009 by Apple Inc.
+# Copyright 2008-2012 by Apple Inc.
 #
 # This script is not compatible with BSD (or any other) install program, as it
 # allows owner and group changes to fail with a warning and makes sure that the
@@ -46,6 +44,7 @@ chgrpprog="${CHGRPPROG-chgrp}"
 stripprog="${STRIPPROG-strip}"
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
+gzipprog="${GZIPPROG-gzip}"
 
 transformbasename=""
 transform_arg=""
@@ -60,6 +59,11 @@ src=""
 dst=""
 dir_arg=""
 
+gzipcp() {
+       # gzipcp from to
+       $gzipprog -9 <"$1" >"$2"
+}
+
 while [ x"$1" != x ]; do
        case $1 in
                -c)
@@ -101,6 +105,12 @@ while [ x"$1" != x ]; do
                continue
                ;;
 
+               -z)
+               instcmd="gzipcp"
+               shift
+               continue
+               ;;
+
                *)
                if [ x"$src" = x ]; then
                        src="$1"
@@ -121,7 +131,7 @@ fi
 if [ x"$dir_arg" != x ]; then
        dst="$src"
        src=""
-       
+
        if [ -d "$dst" ]; then
                instcmd=:
        else
@@ -129,13 +139,13 @@ if [ x"$dir_arg" != x ]; then
        fi
 else
        # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-       # might cause directories to be created, which would be especially bad 
+       # might cause directories to be created, which would be especially bad
        # if $src (and thus $dsttmp) contains '*'.
        if [ ! -f "$src" -a ! -d "$src" ]; then
                echo "install: $src does not exist"
                exit 1
        fi
-       
+
        if [ x"$dst" = x ]; then
                echo "install: No destination specified"
                exit 1
@@ -209,11 +219,11 @@ else
        # Update permissions and strip as needed, then move to the final name.
        # If the chmod, strip, rm, or mv commands fail, remove the installed
        # file...
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $stripopt "$dsttmp" || echo "warning: Unable to strip $dst!"; fi
        if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp" || echo "warning: Unable to change owner of $dst!"; fi
        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp" || echo "warning: Unable to change group of $dst!"; fi
 
        trap "rm -f ${dsttmp}" 0 &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $stripopt "$dsttmp"; fi &&
        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; fi &&
        $doit $rmcmd -f "$dstdir/$dstfile" &&
        $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"