[csw-devel] SF.net SVN: gar:[14970] csw/mgar/pkg/cswclassutils/trunk/files
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Sat Jul 2 19:06:33 CEST 2011
Revision: 14970
http://gar.svn.sourceforge.net/gar/?rev=14970&view=rev
Author: bdwalton
Date: 2011-07-02 17:06:32 +0000 (Sat, 02 Jul 2011)
Log Message:
-----------
cswclassutils/trunk: add etcshells CAS (newly written)
Added Paths:
-----------
csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswetcshells
csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswetcshells
Added: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswetcshells
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswetcshells (rev 0)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswetcshells 2011-07-02 17:06:32 UTC (rev 14970)
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# i.cswetcshells - Class action script for CSW /etc/shells registrations
+#
+# Written and maintained by Ben Walton
+#
+# 2011-07-02 Initial release
+
+echo "Installing class <cswetcshells> ..."
+
+PIR=${PKG_INSTALL_ROOT:-/}
+
+shellfile=$PIR/etc/shells
+
+while read src dest; do
+ echo $dest
+ /usr/bin/cp $src $dest || exit 2
+
+ shell=$dest
+
+ if [ ! -f "$shellfile" ]; then
+ echo "Creating /etc/shells with default set of shells (see: man shells)"
+ cat <<EOF >$shellfile
+/bin/bash
+/bin/csh
+/bin/jsh
+/bin/ksh
+/bin/pfcsh
+/bin/pfksh
+/bin/pfsh
+/bin/sh
+/bin/tcsh
+/bin/zsh
+/sbin/jsh
+/sbin/sh
+/usr/bin/bash
+/usr/bin/csh
+/usr/bin/jsh
+/usr/bin/ksh
+/usr/bin/pfcsh
+/usr/bin/pfksh
+/usr/bin/pfsh
+/usr/bin/sh
+/usr/bin/tcsh
+/usr/bin/zsh
+EOF
+ fi
+
+ exists=`awk "\\\$1 == \"$shell\" { print \"found\" }" $shellfile`
+
+ if [ "$exists" != "found" ]; then
+ echo "Registering $shell in $shellfile."
+ echo "$shell # $PKGINST" >> $shellfile
+ else
+ echo "Not registering $shell in $shellfile. It is already registered."
+ fi
+done
+
+exit 0
Added: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswetcshells
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswetcshells (rev 0)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.r.cswetcshells 2011-07-02 17:06:32 UTC (rev 14970)
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# r.cswetcshells - Class action script for CSW /etc/shells registrations
+#
+# Written and maintained by Ben Walton
+#
+# 2011-07-02 Initial release
+
+while read dest; do
+ echo $dest
+ perl -ani.csw -e "print \"@F\n\" unless \$F[0] eq \"$dest\"" /etc/shells
+ rm -f $dest
+done
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