SF.net SVN: gar:[22336] csw/mgar/pkg/svr4pkg/trunk
chninkel at users.sourceforge.net
chninkel at users.sourceforge.net
Thu Oct 31 00:15:33 CET 2013
Revision: 22336
http://gar.svn.sourceforge.net/gar/?rev=22336&view=rev
Author: chninkel
Date: 2013-10-30 23:15:33 +0000 (Wed, 30 Oct 2013)
Log Message:
-----------
svr4pkg/trunk: added standard class action scripts
Modified Paths:
--------------
csw/mgar/pkg/svr4pkg/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/svr4pkg/trunk/files/i.awk.sh
csw/mgar/pkg/svr4pkg/trunk/files/i.build.sh
csw/mgar/pkg/svr4pkg/trunk/files/i.preserve.sh
csw/mgar/pkg/svr4pkg/trunk/files/i.sed.sh
csw/mgar/pkg/svr4pkg/trunk/files/r.awk.sh
csw/mgar/pkg/svr4pkg/trunk/files/r.build.sh
csw/mgar/pkg/svr4pkg/trunk/files/r.sed.sh
Modified: csw/mgar/pkg/svr4pkg/trunk/Makefile
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/Makefile 2013-10-30 21:46:06 UTC (rev 22335)
+++ csw/mgar/pkg/svr4pkg/trunk/Makefile 2013-10-30 23:15:33 UTC (rev 22336)
@@ -32,6 +32,8 @@
NATIVE_TOOLS = pkgadd pkgrm pkginfo pkgchk pkgparam installf removef
+CAS_LOCATION = /var/sadm/install/scripts
+
install-custom:
@echo " ==> Installing $(NAME)"
ginstall -d $(DESTDIR)$(bindir)
@@ -39,7 +41,12 @@
cd "$(DESTDIR)$(bindir)" && for TOOL in $(NATIVE_TOOLS); do \
gln -sf svr4pkg "$$TOOL"; \
done
+ ginstall -d $(DESTDIR)$(CAS_LOCATION)
+ cd "$(FILEDIR)" && for CAS in *.sh; do \
+ ginstall $$CAS $(DESTDIR)$(CAS_LOCATION)/$${CAS#.sh}; \
+ done
ginstall -d $(DESTDIR)$(docdir)$(NAME)
ginstall $(WORKSRC)/README.md $(DESTDIR)$(docdir)$(NAME)
+
@$(MAKECOOKIE)
Added: csw/mgar/pkg/svr4pkg/trunk/files/i.awk.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/i.awk.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/i.awk.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# 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 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+error=no
+while read src dest
+do
+ [ "$src" = /dev/null ] && continue
+
+ echo "Modifying $dest"
+
+ # Strip PKG_INSTALL_ROOT from dest if installation is to an
+ # alternate root.
+
+ if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
+ client_dest=`echo $dest | \
+ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+ { print substr($0, length(rootdir)+1)} }'`
+ savepath=$PKGSAV/awk${client_dest}
+ else
+ savepath=$PKGSAV/awk${dest}
+ fi
+
+ dirname=`dirname $savepath`
+ if [ $? -ne 0 ]
+ then
+ error=yes
+ continue
+ fi
+ if [ ! -d $dirname ]
+ then
+ # ignore return code since mkdir has bug
+ mkdir -p $dirname
+ fi
+
+ cp $src $savepath &&
+ /usr/sadm/install/scripts/cmdexec /usr/bin/awk install $savepath $dest
+
+ if [ $? -ne 0 ]
+ then
+ error=yes
+ continue
+ fi
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
Added: csw/mgar/pkg/svr4pkg/trunk/files/i.build.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/i.build.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/i.build.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# 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 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+error=no
+while read src dest
+do
+ [ "$src" = /dev/null ] && continue
+
+ echo "Modifying $dest"
+
+ # Strip PKG_INSTALL_ROOT from dest if installation is to an
+ # alternate root.
+
+ if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
+ client_dest=`echo $dest | \
+ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+ { print substr($0, length(rootdir)+1)} }'`
+ savepath=$PKGSAV/build${client_dest}
+ else
+ savepath=$PKGSAV/build${dest}
+ fi
+
+ dirname=`dirname $savepath`
+ if [ $? -ne 0 ]
+ then
+ error=yes
+ continue
+ fi
+
+ if [ ! -d $dirname ]
+ then
+ # ignore return since mkdir has bug
+ mkdir -p $dirname
+ fi
+
+ cp $src $savepath &&
+ chmod 500 $savepath
+ if [ $? -ne 0 ]
+ then
+ error=yes
+ continue
+ fi
+
+ if $savepath install > /tmp/$$build
+ then
+ if [ -s /tmp/$$build ]
+ then
+ cp /tmp/$$build $dest || error=yes
+ fi
+ else
+ error=yes
+ fi
+ rm -f /tmp/$$build
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
Added: csw/mgar/pkg/svr4pkg/trunk/files/i.preserve.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/i.preserve.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/i.preserve.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# 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 1998 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+
+error=no
+echo "## checking common configuration files"
+while read src dest
+do
+ [ "$src" = /dev/null ] && continue
+
+ if [ -f "$dest" ]
+ then
+ echo $dest preserved
+ else
+ echo $dest
+ cp $src $dest || error=yes
+ fi
+
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
Added: csw/mgar/pkg/svr4pkg/trunk/files/i.sed.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/i.sed.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/i.sed.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# 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 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+error=no
+while read src dest
+do
+ [ "$src" = /dev/null ] && continue
+
+ echo "Modifying $dest"
+
+ # Strip PKG_INSTALL_ROOT from dest if installation is to an
+ # alternate root.
+
+ if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
+ client_dest=`echo $dest | \
+ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+ { print substr($0, length(rootdir)+1)} }'`
+ savepath=$PKGSAV/sed${client_dest}
+ else
+ savepath=$PKGSAV/sed${dest}
+ fi
+
+ dirname=`dirname $savepath`
+ if [ $? -ne 0 ]
+ then
+ error=yes
+ continue
+ fi
+
+ if [ ! -d $dirname ]
+ then
+ # ignore return since mkdir has bug
+ mkdir -p $dirname
+ fi
+
+ cp $src $savepath &&
+ /usr/sadm/install/scripts/cmdexec /bin/sed install $savepath $dest
+
+ if [ $? -ne 0 ]
+ then
+ error=yes
+ fi
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
Added: csw/mgar/pkg/svr4pkg/trunk/files/r.awk.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/r.awk.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/r.awk.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# 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 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+error=no
+while read dest
+do
+ if [ -d $dest ]
+ then
+ echo "$dest"
+ rmdir $dest || error=yes
+ elif [ -f $dest ]
+ then
+ echo "Modifying $dest"
+
+ # Strip PKG_INSTALL_ROOT from dest if installation is to an
+ # alternate root.
+
+ if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
+ client_dest=`echo $dest | \
+ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+ { print substr($0, length(rootdir)+1)} }'`
+ savepath=$PKGSAV/awk${client_dest}
+ else
+ savepath=$PKGSAV/awk${dest}
+ fi
+
+ /usr/sadm/install/scripts/cmdexec /usr/bin/awk remove $savepath $dest ||
+ error=yes
+ else
+ [ -r $dest ] && echo "$dest"
+ rm -f $dest || error=yes
+ fi
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
Added: csw/mgar/pkg/svr4pkg/trunk/files/r.build.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/r.build.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/r.build.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# 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 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+error=no
+while read dest
+do
+ if [ -d $dest ]
+ then
+ echo "$dest"
+ rmdir $dest || error=yes
+ elif [ -f $dest ]
+ then
+ echo "Modifying $dest"
+
+ # Strip PKG_INSTALL_ROOT from dest if installation is to an
+ # alternate root.
+
+ if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
+ client_dest=`echo $dest | \
+ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+ { print substr($0, length(rootdir)+1)} }'`
+ savepath=$PKGSAV/build${client_dest}
+ else
+ savepath=$PKGSAV/build${dest}
+ fi
+
+ chmod +x $savepath
+ if $savepath remove > /tmp/$$build
+ then
+ if [ ! -s /tmp/$$build ]
+ then
+ rm -f $dest
+ else
+ cp /tmp/$$build $dest || error=yes
+ fi
+ else
+ error=yes
+ fi
+ rm -f /tmp/$$build
+ else
+ [ -r $dest ] && echo "$dest"
+ rm -f $dest || error=yes
+ fi
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
Added: csw/mgar/pkg/svr4pkg/trunk/files/r.sed.sh
===================================================================
--- csw/mgar/pkg/svr4pkg/trunk/files/r.sed.sh (rev 0)
+++ csw/mgar/pkg/svr4pkg/trunk/files/r.sed.sh 2013-10-30 23:15:33 UTC (rev 22336)
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# 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 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+error=no
+while read dest
+do
+ if [ -d $dest ]
+ then
+ echo "$dest"
+ rmdir $dest || error=yes
+ elif [ -f $dest ]
+ then
+ echo "Modifying $dest"
+
+ # Strip PKG_INSTALL_ROOT from dest if installation is to an
+ # alternate root.
+
+ if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then
+ client_dest=`echo $dest | \
+ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{
+ { print substr($0, length(rootdir)+1)} }'`
+ savepath=$PKGSAV/sed${client_dest}
+ else
+ savepath=$PKGSAV/sed${dest}
+ fi
+
+ /usr/sadm/install/scripts/cmdexec /bin/sed remove $savepath $dest ||
+ error=yes
+ else
+ [ -r $dest ] && echo "$dest"
+ rm -f $dest || error=yes
+ fi
+done
+[ "$error" = yes ] &&
+ exit 2
+exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list