Danek Duvall wrote:
> 
>     http://cr.opensolaris.org/~dduvall/sfw-p7zip/
> 
> Adds the p7zip utility to SFW.  Review would be most appreciated.

Small 5min race over the patch (patch code is quoted with "> "):
> --- /dev/null Tue Nov 13 12:49:36 2007
> +++ new/usr/src/cmd/p7zip/Makefile.sfw        Tue Nov 13 12:49:36 2007
> +
> +all: $(VER)/makefile
> +     (cd $(VER); env \
> +         LD_OPTIONS="-M $(SRC)/cmd/mapfile_noexstk" \
> +         MAKE=/usr/ccs/bin/make \
> +         /usr/ccs/bin/make -e all3)
> +     @find . -name core -exec rm -f {} \;
> +

AFAIK it may be nice to add "-xstrconst" to CFLAGS and check whether the
suggestions in
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6628305 make
any difference for this application.

> --- /dev/null   Tue Nov 13 12:49:36 2007
> +++ new/usr/src/cmd/p7zip/install-p7zip Tue Nov 13 12:49:36 2007
> @@ -0,0 +1,55 @@
> +#!/bin/ksh

Please use "#!/usr/bin/ksh -p" or "#!/usr/bin/ksh93" (e.g. /bin -->
/usr/bin/ and ksh88 needs "-p" (ksh93 doesn't need this anymore))

[sinp]
> +# ident        "@(#)install-p7zip      1.1     07/11/13 SMI"

General note for this type of script: Please add a $ set -o errexit # at
the beginning that the script - the "errexit" flag causes the shell to
immediately abort the script when it hits a command which returns a
failure instead of continuing operation (and maybe running amok (and
ordering 12 refurbished F/A-18B via your EBay-account etc. =:-) ))

> +
> +VERS=p7zip_4.55
> +
> +PREFIX=$ROOT/usr
> +BINDIR=$PREFIX/bin
> +LIBDIR=$PREFIX/lib/7z
> +MANDIR=$PREFIX/share/man/man1
> +MANSCRIPT=../sunman-stability
> +
> +. ${SRC}/tools/install.subr

Plese change this to...
-- snip --
source "${SRC}/tools/install.subr"
-- snip --
 
> +
> +cd ${VERS}
> +
> +for f in bin/7z bin/7za bin/7zr; do
> +       _install E $f $BINDIR/${f#*/} 555

Please use quotes, e.g. change this to...
-- snip --
_install E "$f" "$BINDIR/${f#*/}" 555
-- snip --

> +done
> +
> +for f in bin/7z.so bin/Codecs/Rar29.so; do
> +       _install D $f $LIBDIR/${f#*/} 555

Please use quotes...

> +done
> +
> +for f in man1/7z.1 man1/7za.1 man1/7zr.1; do
> +       _install M $f $MANDIR/${f#*/} 444

Please use quotes...

> +done
> +
> +_install S contrib/gzip-like_CLI_wrapper_for_7z/p7zip $BINDIR/p7zip 555
> +_install M contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 $MANDIR/p7zip.1 
> 444

Please use quotes, e.g. change this to...
-- snip --
_install S contrib/gzip-like_CLI_wrapper_for_7z/p7zip "$BINDIR/p7zip"
555
_install M contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1
"$MANDIR/p7zip.1" 444
-- snip --

> +
> +exit 0

I've attached these changes as "install-p7zip.new.txt" ...

... AFAIK that's all what I can find in a 5min race...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)
-------------- next part --------------
#!/usr/bin/ksh93
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)install-p7zip      1.1     07/11/13 SMI"

# stop the script at the first error
set -o errexit

VERS="p7zip_4.55"

PREFIX="$ROOT/usr"
BINDIR="$PREFIX/bin"
LIBDIR="$PREFIX/lib/7z"
MANDIR="$PREFIX/share/man/man1"
MANSCRIPT="../sunman-stability"

source "${SRC}/tools/install.subr"

cd "${VERS}"

for f in bin/7z bin/7za bin/7zr; do
        _install E "$f" "$BINDIR/${f#*/}" 555
done

for f in bin/7z.so bin/Codecs/Rar29.so; do
        _install D "$f" "$LIBDIR/${f#*/}" 555
done

for f in man1/7z.1 man1/7za.1 man1/7zr.1; do
        _install M "$f" "$MANDIR/${f#*/}" 444
done

_install S contrib/gzip-like_CLI_wrapper_for_7z/p7zip "$BINDIR/p7zip" 555
_install M contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 "$MANDIR/p7zip.1" 
444

exit 0

Reply via email to