SF.net SVN: gar:[22594] csw/mgar/pkg/cswclassutils/trunk/files

pfelecan at users.sourceforge.net pfelecan at users.sourceforge.net
Thu Nov 28 10:28:24 CET 2013


Revision: 22594
          http://gar.svn.sourceforge.net/gar/?rev=22594&view=rev
Author:   pfelecan
Date:     2013-11-28 09:28:24 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
cswclassutils/trunk: new CAS for DICT dictionaries registering

Modified Paths:
--------------
    csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.README.CSW

Added Paths:
-----------
    csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswdictconf
    csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswdictconf

Modified: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.README.CSW
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.README.CSW	2013-11-27 21:06:33 UTC (rev 22593)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.README.CSW	2013-11-28 09:28:24 UTC (rev 22594)
@@ -72,6 +72,13 @@
   all TeX packages installed. It adds index entries on package
   installation and removes them on package removal.
 
+- cswdictconf
+
+  This class takes care of keeping the dictionaries used by the DICT
+  server in sync with all the dictionary packages installed. It add
+  entries in the servers configuration on package installation and
+  removes them on package removal.
+
 Read more on the wiki: http://wiki.opencsw.org/cswclassutils-package.
 
 -- 

Added: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswdictconf
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswdictconf	                        (rev 0)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswdictconf	2013-11-28 09:28:24 UTC (rev 22594)
@@ -0,0 +1,46 @@
+#!/bin/sh
+# $Id$
+#
+# i.cswdictconf - Class action script
+# 		 for registering dictionary packages
+#
+# Copyright (C) 2013 Peter Felecan peter at felecan.org
+#
+# This file is part of cswclassutils  package offered by OpenCSW
+#
+# This script is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This script is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this script.  If not, see <http://www.gnu.org/licenses/>.
+
+echo "Installing class <cswdictconf> ..."
+
+while read src dest; do
+  echo $dest
+  /usr/bin/cp $src $dest || exit 2
+done
+
+if [ -x ${PKG_INSTALL_ROOT}/opt/csw/sbin/dictdconfig ]
+then
+{
+	echo "Registering Dictionaries. This may take some time..."
+	/usr/sbin/chroot ${PKG_INSTALL_ROOT:-/} /opt/csw/sbin/dictdconfig --write ||
+	echo "Registering Dictionaries failed! You need to run dictdconfig again"
+	/usr/sbin/chroot ${PKG_INSTALL_ROOT:-/} /usr/bin/pkill -HUP dictd ||
+	echo "reload request to DICT server failed"
+}
+else
+{
+    echo "$dest (Dictionaries will be registered when CSWdictd is installed)"
+}
+fi
+
+exit 0

Added: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswdictconf
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswdictconf	                        (rev 0)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswdictconf	2013-11-28 09:28:24 UTC (rev 22594)
@@ -0,0 +1,48 @@
+#!/bin/sh
+# $Id$
+#
+# r.cswdictconf - Class action script
+# 		 for unregistering dictionary packages
+#
+# Copyright (C) 2013 Peter Felecan peter at felecan.org
+#
+# This file is part of cswclassutils  package offered by OpenCSW
+#
+# This script is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This script is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this script.  If not, see <http://www.gnu.org/licenses/>.
+
+echo "Removing class <cswdictconf> ..."
+
+while read dest; do
+
+  echo $dest
+  if [ -d $dest ]; then
+	  rmdir $dest
+  else
+	  rm -f $dest
+  fi
+
+done
+
+if [ -x ${PKG_INSTALL_ROOT}/opt/csw/sbin/dictdconfig ]
+then
+{
+	echo "Unregistering Dictionaries. This may take some time..."
+	/usr/sbin/chroot ${PKG_INSTALL_ROOT:-/} /opt/csw/sbin/dictdconfig --write ||
+	echo "Unregistering Dictionaries failed! You need to run dictdconfig again"
+	/usr/sbin/chroot ${PKG_INSTALL_ROOT:-/} /usr/bin/pkill -HUP dictd ||
+	echo "reload request to DICT server failed"
+}
+fi
+
+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