Index: ossp-pkg/rc/rc.pod
RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.pod,v
rcsdiff -q -kk '-r1.13' '-r1.14' -u '/v/ossp/cvs/ossp-pkg/rc/rc.pod,v' 2>/dev/null
--- rc.pod 2002/01/23 13:44:50 1.13
+++ rc.pod 2002/01/23 14:58:51 1.14
@@ -23,6 +23,106 @@
## SUCH DAMAGE.
##
+# ref: %start; %stop
+# cfg
+# def --showdefault, --defsetion=config
+
+# --dir=dir1:dir2:..
+# --rcfile='rc.%s'
+# --regex-section='(?<=^|\n)%%%s\s*\n(.+?)(?=\n%\S+|$)'
+# --regex-param='..'
+# --regex-reference='(?<=^|\n)%%%s\s*(.+?)(?=\n|;)'
+# --regex-config='(\s+)=(.*)$'
+# --name-config=config
+# --name-common=common
+
+# RegexSection (?<=^|\n)%%%s\s*\n(.+?)(?=\n%\S+|$)
+
+# Examples:
+
+# rc.foo
+%config
+ foo=1
+ bar=2
+%start -u root -p 200
+ /cw/bin/fooctl start $foo
+%stop -u root -p 200
+ /cw/bin/fooctl stop $bar
+%restart -u root
+ %stop
+ sleep 1
+ %start
+%foo -c /usr/bin/perl
+ print STDERR "foo";
+
+
+
+ 1
+ 2
+
+
+ /cw/bin/fooctl start $foo
+
+
+ /cw/bin/fooctl stop $bar
+
+
+ %stop
+ sleep 1
+ %start
+
+
+ print STDERR "foo";
+
+
+rc [ ...]
+
+foreach sec in [ ...] {
+ foreach dir in --dir=dir1:dir2:.. {
+ search for --rcfile where %s is
+ parse rcfile into blocks according to --regex-section/etc.
+ remember common/ into list
+ }
+ // we now have an unsorted list of common/
+ sort list of common/ according to their priority (see --regex-param)
+
+ // execution
+ forearch common/ in list {
+ prepend config section
+ prepend common section
+ expand references accordingf to --regex-reference
+ execute result as user/group (see --regex-param) with interpreter (see --regex-param)
+ }
+}
+
+
+cd () {
+ eval `rc --eval --rcfunc=$HOME/.cdfunc --rcfile-owner=$USER --rcfile-umask=022 --dir .:..:../..:../../.. --rcfile .cd all leave`
+ builtin cd ${1+"$@"}
+ eval `rc --eval --rcfunc=$HOME/.cdfunc --rcfile-owner=$USER --rcfile-umask=022 --dir .:..:../..:../../.. --rcfile .cd all enter`
+}
+
+# $HOME/.cdfunc
+AddPath () {
+ ...
+}
+RemPath () {
+ ...
+}
+
+# .cd
+%enter
+ FOO=1
+ export FOO
+ AddPath `pwd`/bin
+%leave
+ unset FOO
+ RemPath `pwd`/bin
+
+TODO:
+- error semantic: imediate faulure or skip failured
+- security => --rcfile-umask
+
=pod
=head1 NAME
@@ -48,6 +148,7 @@
[B<-r>|B<--raw>]
[B<-v>|B<--verbose>]
[B<-D>|B<--debug>]
+[I]
[I]
[I]