diff options
author | jlam <jlam@pkgsrc.org> | 2007-06-20 16:18:36 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2007-06-20 16:18:36 +0000 |
commit | 33da0f06018f58d7daf23543ee3a3cdd751f7fc9 (patch) | |
tree | 319dcaf1bae57cb03667b9e2135d4b5eb5dfba35 | |
parent | f4f566154533a4170c2e0fe6af07a7c4b01a2e00 (diff) | |
download | pkgsrc-33da0f06018f58d7daf23543ee3a3cdd751f7fc9.tar.gz |
Update sysutils/install-sh to 20070620. Changes from the previous
version include modifications to the script to pass the regression
test suite in regress/bootstrap-install-sh. This makes the installed
install-sh script more closely match NetBSD's /usr/bin/install.
-rw-r--r-- | doc/CHANGES-2007 | 3 | ||||
-rw-r--r-- | sysutils/install-sh/Makefile | 4 | ||||
-rw-r--r-- | sysutils/install-sh/files/install-sh.in | 127 |
3 files changed, 64 insertions, 70 deletions
diff --git a/doc/CHANGES-2007 b/doc/CHANGES-2007 index 72f0f77df03..573424e7fc1 100644 --- a/doc/CHANGES-2007 +++ b/doc/CHANGES-2007 @@ -1,4 +1,4 @@ -$NetBSD: CHANGES-2007,v 1.1425 2007/06/19 22:23:58 bouyer Exp $ +$NetBSD: CHANGES-2007,v 1.1426 2007/06/20 16:18:36 jlam Exp $ Changes to the packages collection and infrastructure in 2007: @@ -2648,3 +2648,4 @@ Changes to the packages collection and infrastructure in 2007: Added pkgtools/pbulk version 0.1 [root 2007-06-19] Updated shells/mksh to 29.6 [joerg 2007-06-19] Updated sysutils/apcupsd to 3.14.1nb2 [bouyer 2007-06-20] + Updated sysutils/install-sh to 20070620 [jlam 2007-06-20] diff --git a/sysutils/install-sh/Makefile b/sysutils/install-sh/Makefile index 6bd9a6772f6..2e86622d447 100644 --- a/sysutils/install-sh/Makefile +++ b/sysutils/install-sh/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.1.1.1 2006/07/17 14:19:01 jlam Exp $ +# $NetBSD: Makefile,v 1.2 2007/06/20 16:18:36 jlam Exp $ -DISTNAME= install-sh-20060714 +DISTNAME= install-sh-20070620 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/sysutils/install-sh/files/install-sh.in b/sysutils/install-sh/files/install-sh.in index cf1d0d972ff..c148df03494 100644 --- a/sysutils/install-sh/files/install-sh.in +++ b/sysutils/install-sh/files/install-sh.in @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: install-sh.in,v 1.1.1.1 2006/07/17 14:19:01 jlam Exp $ +# $NetBSD: install-sh.in,v 1.2 2007/06/20 16:18:36 jlam Exp $ # This script now also installs multiple files, but might choke on installing # multiple files with spaces in the file names. # @@ -101,92 +101,80 @@ while [ x"$1" != x ]; do shift continue;; - *) if [ x"$src" = x ] + *) if [ x"$msrc" = x ] then - src=$1 - msrc=$1 + msrc="$dst" else - # this colon is to work around a 386BSD /bin/sh bug - : - msrc="$msrc $1" - dst=$1 + msrc="$msrc $dst" fi + src="$dst" + dst="$1" shift continue;; esac done -if [ x"$dir_arg" = x -a x"$msrc" != x"$src $dst" ] +if [ x"$dir_arg" = x ] then - if [ ! -d "$dst" ]; then - echo "install: destination is not a directory" - exit 1 + dstisfile="" + if [ ! -d "$dst" ] + then + if [ x"$msrc" = x"$src" ] + then + dstisfile=true + else + echo "install: destination is not a directory" + exit 1 + fi fi else - msrc=$src + msrc="$msrc $dst" fi - -if [ x"$src" = x ] +if [ x"$msrc" = x ] then - echo "install: no input file specified" + echo "install: no destination specified" exit 1 -else - true -fi +fi + +for srcarg in $msrc; do if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi + + dstarg="$srcarg" else + dstarg="$dst" -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# Waiting for this to be detected by the "$instcmd $srcarg $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. - if [ -f "$src" ] + if [ -f "$srcarg" ] then - true - elif [ -d "$src" ] + doinst="$instcmd" + elif [ -d "$srcarg" ] then - echo "install: $src: not a regular file" + echo "install: $srcarg: not a regular file" exit 1 - elif [ x"$src" = x"/dev/null" ] + elif [ "$srcarg" = "/dev/null" ] then - instcmd="$cpprog" + doinst="$cpprog" else - echo "install: $src does not exist" + echo "install: $srcarg does not exist" exit 1 fi - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic - if [ -d "$dst" ] + if [ -d "$dstarg" ] then - dst="$dst"/`basename "$src"` - else - true + dstarg="$dstarg"/`basename "$srcarg"` fi fi ## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` +dstdir=`echo "$dstarg" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script @@ -211,7 +199,11 @@ while [ $# -ne 0 ] ; do if [ ! -d "${pathcomp}" ] ; then - $mkdirprog "${pathcomp}" + $doit $mkdirprog "${pathcomp}" + if [ x"$chowncmd" != x ]; then $doit $chowncmd "${pathcomp}"; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "${pathcomp}"; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "${pathcomp}"; else true ; fi + else true fi @@ -220,25 +212,26 @@ while [ $# -ne 0 ] ; do done fi -if [ x"$dir_arg" != x ] -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 $stripflags "$dst"; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else true ; fi -else + if [ x"$dir_arg" != x ] + then + if [ -d "$dstarg" ]; then + true + else + $doit $mkdirprog "$dstarg" && -# If we're going to rename the final executable, determine the name now. + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dstarg"; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dstarg"; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dstarg"; else true ; fi + fi + else - for arg in `echo "$msrc"| sed -e 's/ [^ ]*$//'`; do +# If we're going to rename the final file, determine the name now. - if [ x"$msrc" = x"$src" ] + if [ x"$dstisfile" = x ] then - file=$dst + file=$srcarg else - file=$arg + file=$dst fi if [ x"$transformarg" = x ] @@ -264,7 +257,7 @@ else # Move or copy the file name to the temp name - $doit $instcmd $arg "$dsttmp" && + $doit $doinst $srcarg "$dsttmp" && trap "rm -f ${dsttmp}" 0 && @@ -283,9 +276,9 @@ else $doit $rmcmd -f "$dstdir/$dstfile" && $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - done + fi -fi && +done && exit 0 |