Pradhap Devarajan wrote: > Please review the code for librsync integration into SFW consolidation > > webrev is located at: > http://cr.opensolaris.org/~pd155743/librsync/
5min race through http://cr.opensolaris.org/~pd155743/librsync/librsync.patch (patch code is quoted with "> "): > --- /dev/null Mon Apr 28 08:13:50 2008 > +++ new/usr/src/lib/librsync/Makefile.sfw Mon Apr 28 08:13:50 2008 > @@ -0,0 +1,91 @@ > +# > +# 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 2008 Sun Microsystems, Inc. All rights reserved. > +# Use is subject to license terms. > +# > +# ident "@(#)Makefile.sfw 1.1 08/04/28 SMI" > + > +VER=librsync-0.9.7 > +VER64=$(VER)-64 > + > +include ../Makefile.lib > + > +CONFIGURE_OPTIONS += --enable-shared Please add... -- snip -- CFLAGS += -xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -xstrconst CFLAGS64 += -xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -xstrconst -- snip -- ... the "-xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1" is for C99/XPG6 conformance and the "-xstrconst" pust all string literals into read-only memory (e.g. it's shard between processes and won't waste memory then). > + > +all: real-all > + > +all32: $(VER)/config.status > +install: all > + $(SH) ./install-sfw > + MACH64=$(MACH64) $(SH) ./install-sfw-64 Please replace $(SH) with /usr/bin/ksh93 - I rewrote your "install-sfw" and "install-sfw-64" scripts to match http://www.opensolaris.org/os/project/shell/shellstyle/ (main issue of these scripts was that it didn't set "set -o errexit" and simply continued even if there were errors, put constant string literals into read-only memory (typeset -r ...) beyond that I added missing double-quotes and did some POSIX'ifying of the script). > +$(VER)/config.status: $(VER)/configure > + (cd $(VER); env \ > + CC=$(CC) CXX=$(CCC) F77=f77 \ > + PATH=$(SFW_PATH) \ Please add double-quotes around "$(SFW_PATH)" ... > + MAKE=$(CCSMAKE) \ Please add double-quotes, too... > + ./configure $(CONFIGURE_OPTIONS)) > + > +$(VER64)/config.status: $(VER64)/configure > + (cd $(VER64); env \ > + CC=$(CC) CXX=$(CCC) F77=f77 \ > + PATH=$(SFW_PATH) \ Please add double-quotes, too... > + MAKE=$(CCSMAKE) \ Please add double-quotes, too... > + "CFLAGS=$(CFLAGS64)" \ > + ./configure $(CONFIGURE_OPTIONS)) > +clean: > + -rm -rf $(VER) > + -rm -rf $(VER64) Please combine this into one "rm" statement and add double-quotes to avoid that "rm" may run amok when VER/VER64 contains garbage, e.g. -- snip -- -rm -rf \ "$(VER)" \ "$(VER64)" -- snip -- ---- 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 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)install-sfw 1.2 08/04/28 SMI" # exit script if a utilty returns an error set -o errexit # load builtin commands builtin basename builtin mkdir builtin rm typeset -r VERS="librsync-0.9.7" typeset -r PREFIX="${ROOT}/usr" typeset -r BINDIR="${PREFIX}/bin" typeset -r LIBDIR="${PREFIX}/lib" typeset -r INCDIR="${PREFIX}/include" typeset -r SHAREDIR="${PREFIX}/share" typeset -r MAN1DIR="${SHAREDIR}/man/man1" typeset -r MAN3DIR="${SHAREDIR}/man/man3" typeset -r DOCDIR="${SHAREDIR}/doc/${VERS}" typeset -r TOP="${PWD}" source "${SRC}/tools/install.subr" typeset -r MANSCRIPT=sunman-stability for i in ${VERS}/doc/*.1 ; do manpage="$(basename $i | sed 's/^z/gz/')" _install M "${i}" "${MAN1DIR}/${manpage}" 444 done for i in ${VERS}/doc/*.3 do manpage="$(basename $i | sed 's/^z/gz/')" _install M "${i}" "${MAN3DIR}/${manpage}" 444 done cd "${VERS}" _install E .libs/rdiff "${BINDIR}/rdiff" 555 _install D .libs/librsync.so.1.0.2 "${LIBDIR}/librsync.so.1.0.2" 555 _install N librsync.h "${INCDIR}/librsync.h" 444 _install N librsync-config.h "${INCDIR}/librsync-config.h" 444 _install L librsync.so.1.0.2 "${LIBDIR}/librsync.so" _install L librsync.so.1.0.2 "${LIBDIR}/librsync.so.1" cd "${TOP}" _install N docs/librsync.pdf "${DOCDIR}/librsync.pdf" 444 rm -rf "${DOCDIR}/html " gzip -cd docs/html.tar.gz | (cd "${DOCDIR}" ; tar fx -) cd "${DOCDIR}" find . -type f -exec chmod 0444 {} \; find . -type d -exec chmod 0755 {} \; exit 0 -------------- 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 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)install-sfw-64 1.2 08/04/28 SMI" # exit script if a utilty returns an error set -o errexit # load builtin commands builtin basename builtin mkdir builtin rm typeset -r VERS="librsync-0.9.7-64" typeset -r PREFIX=${ROOT}/usr typeset -r BINDIR=${PREFIX}/bin/${MACH64} typeset -r LIBDIR=${PREFIX}/lib/${MACH64} typeset -r INCDIR=${PREFIX}/include typeset -r SHAREDIR=${PREFIX}/share typeset -r MAN1DIR=${SHAREDIR}/man/man1 typeset -r MAN3DIR=${SHAREDIR}/man/man3 source "${SRC}/tools/install.subr" MANSCRIPT=sunman-stability for i in ${VERS}/doc/*.1 ; do manpage="$(basename $i | sed 's/^z/gz/')" _install M ${i} ${MAN1DIR}/${manpage} 444 done for i in ${VERS}/doc/*.3 ; do manpage="$(basename $i | sed 's/^z/gz/')" _install M "${i}" "${MAN3DIR}/${manpage}" 444 done cd "${VERS}" _install E .libs/rdiff "${BINDIR}/rdiff" 555 _install D .libs/librsync.so.1.0.2 "${LIBDIR}/librsync.so.1.0.2" 555 _install N librsync.h "${INCDIR}/librsync.h" 444 _install N librsync-config.h "${INCDIR}/librsync-config.h" 444 _install L librsync.so.1.0.2 "${LIBDIR}/librsync.so" _install L librsync.so.1.0.2 "${LIBDIR}/librsync.so.1" exit 0
