[csw-devel] SF.net SVN: gar:[8486] csw/mgar/pkg/chkconfig/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Thu Feb 11 13:04:42 CET 2010


Revision: 8486
          http://gar.svn.sourceforge.net/gar/?rev=8486&view=rev
Author:   dmichelsen
Date:     2010-02-11 12:04:42 +0000 (Thu, 11 Feb 2010)

Log Message:
-----------
alternatives: Add class actions scripts

Modified Paths:
--------------
    csw/mgar/pkg/chkconfig/trunk/Makefile
    csw/mgar/pkg/chkconfig/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.i.cswalternatives
    csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.r.cswalternatives

Modified: csw/mgar/pkg/chkconfig/trunk/Makefile
===================================================================
--- csw/mgar/pkg/chkconfig/trunk/Makefile	2010-02-11 11:48:30 UTC (rev 8485)
+++ csw/mgar/pkg/chkconfig/trunk/Makefile	2010-02-11 12:04:42 UTC (rev 8486)
@@ -13,6 +13,8 @@
 
 MASTER_SITES = http://www.sfr-fresh.com/unix/privat/
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
+DISTFILES += CSWalternatives.i.cswalternatives
+DISTFILES += CSWalternatives.r.cswalternatives
 PATCHFILES = alloca.patch
 PATCHFILES += 0001-Add-missing-include-to-alloca.h.patch
 PATCHFILES += 0002-Don-t-use-named-struct-initializers.patch
@@ -42,4 +44,7 @@
 post-merge:
 	ginstall -d $(PKGROOT)/etc/opt/csw/alternatives
 	ginstall -d $(PKGROOT)/var/opt/csw/alternatives
+	ginstall -d $(PKGROOT)/usr/sadm/install/scripts
+	ginstall $(WORKDIR)/CSWalternatives.i.cswalternatives $(PKGROOT)/usr/sadm/install/scripts/i.cswalternatives
+	ginstall $(WORKDIR)/CSWalternatives.r.cswalternatives $(PKGROOT)/usr/sadm/install/scripts/r.cswalternatives
 	@$(MAKECOOKIE)

Modified: csw/mgar/pkg/chkconfig/trunk/checksums
===================================================================
--- csw/mgar/pkg/chkconfig/trunk/checksums	2010-02-11 11:48:30 UTC (rev 8485)
+++ csw/mgar/pkg/chkconfig/trunk/checksums	2010-02-11 12:04:42 UTC (rev 8486)
@@ -1,5 +1,7 @@
 d56d4f7b5aef5af5235943c384734780  0001-Add-missing-include-to-alloca.h.patch
 a1045173b8bc0a667883080f85a38597  0002-Don-t-use-named-struct-initializers.patch
 5abe74bf8f38f45068f43f12b52cfc4b  0003-Fix-manpage-to-use-csw-pathes.patch
+9fcb33b563739c901979bee70a76fb69  CSWalternatives.i.cswalternatives
+b894fb63bd824403aa56034ac6a0bb57  CSWalternatives.r.cswalternatives
 02019af22d048085f3006de791a0c95e  alloca.patch
 592a1fe77f3844d7748adbab6357ee25  chkconfig-1.3.30c.tar.gz

Added: csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.i.cswalternatives
===================================================================
--- csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.i.cswalternatives	                        (rev 0)
+++ csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.i.cswalternatives	2010-02-11 12:04:42 UTC (rev 8486)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# i.cswalternatives - Class action script for
+# registering applications in alternatives
+#
+# Written and maintained by Dagobert Michelsen
+#
+# 2010-02-11 Initial release
+
+: ${PKG_INSTALL_ROOT:=/}
+
+while read src dest; do
+  /usr/bin/cp $src $dest || exit 2
+
+  cat $dest | while read C; do
+    set -- $C
+
+    echo "Registering alternative $3 ..."
+
+    A="--install $1 $2 $3 $4"
+    shift; shift; shift; shift
+
+    while [ $# -gt 0 ]; do
+      A="$A --slave $1 $2 $3"
+      shift; shift; shift
+    done
+    
+    if [ -x ${PKG_INSTALL_ROOT}/opt/csw/sbin/alternatives ]; then
+      chroot ${PKG_INSTALL_ROOT} /opt/csw/sbin/alternatives $A
+    else
+      echo "ERROR: /opt/csw/sbin/alternatives could not be found" >&2
+      exit 2
+    fi
+  done
+done
+
+exit 0

Added: csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.r.cswalternatives
===================================================================
--- csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.r.cswalternatives	                        (rev 0)
+++ csw/mgar/pkg/chkconfig/trunk/files/CSWalternatives.r.cswalternatives	2010-02-11 12:04:42 UTC (rev 8486)
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# r.cswalternatives - Class action script for
+# registering applications in alternatives
+#
+# Written and maintained by Dagobert Michelsen
+#
+# 2010-02-11 Initial release
+
+: ${PKG_INSTALL_ROOT:=/}
+
+while read dest; do
+  cat $dest | while read C; do
+    set -- $C
+
+    echo "Unregistering alternative $3 ..."
+
+    if [ -x ${PKG_INSTALL_ROOT}/opt/csw/sbin/alternatives ]; then
+      chroot ${PKG_INSTALL_ROOT} /opt/csw/sbin/alternatives --remove $2 $3
+    else
+      echo "ERROR: /opt/csw/sbin/alternatives could not be found" >&2
+      exit 2
+    fi
+  done
+done
+
+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