autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Optimization for install-sh


From: Pavel Roskin
Subject: Optimization for install-sh
Date: Wed, 8 Nov 2000 16:44:47 -0500 (EST)

Hello!

I'm not sure who is in charge of install-sh now and whether its main
source is the Autoconf directory, but the last person who modified it
according to "cvs log" is Ben Elliston and it's documented in the
Autoconf's ChangeLog.

bash-1.x and possibly other shells don't have the "true" builtin. That's
why Autoconf uses ":" instead. It's faster and (potentially) safer since
it works even if "true" is not in $PATH.

I assume that the speed factor is important on old machines lacking BSD
install.

ChangeLog:
        * install-sh: Use ":" instead of "true" everywhere.

Regards,
Pavel Roskin

_________________________
Index: install-sh
--- install-sh  Thu Feb 25 13:31:19 1999
+++ install-sh  Wed Nov  8 16:17:46 2000
@@ -109,7 +109,7 @@
        echo "install:  no input file specified"
        exit 1
 else
-       true
+       :
 fi
 
 if [ x"$dir_arg" != x ]; then
@@ -130,7 +130,7 @@
 
        if [ -f $src -o -d $src ]
        then
-               true
+               :
        else
                echo "install:  $src does not exist"
                exit 1
@@ -141,7 +141,7 @@
                echo "install:  no destination specified"
                exit 1
        else
-               true
+               :
        fi
 
 # If destination is a directory, append the input filename; if your system
@@ -151,7 +151,7 @@
        then
                dst="$dst"/`basename $src`
        else
-               true
+               :
        fi
 fi
 
@@ -183,7 +183,7 @@
         then
                $mkdirprog "${pathcomp}"
        else
-               true
+               :
        fi
 
        pathcomp="${pathcomp}/"
@@ -194,10 +194,10 @@
 then
        $doit $instcmd $dst &&
 
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
 else
 
 # If we're going to rename the final executable, determine the name now.
@@ -216,7 +216,7 @@
        then
                dstfile=`basename $dst`
        else
-               true
+               :
        fi
 
 # Make a temp file name in the proper directory.
@@ -235,10 +235,10 @@
 # ignore errors from any of these, just make sure not to ignore
 # errors from the above "$doit $instcmd $src $dsttmp" command.
 
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
 
 # Now rename the file to the real destination.
 
_________________________





reply via email to

[Prev in Thread] Current Thread [Next in Thread]