summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.bak42
-rw-r--r--Makefile.orig55
-rw-r--r--Variables5
-rwxr-xr-xconfigure59
-rw-r--r--docs/README.xhtml116
-rwxr-xr-xsource/rvs (renamed from usr/bin/rvs)4
-rwxr-xr-xsource/rvs-core/commit (renamed from etc/abomination/modules/rvs/commit)22
-rwxr-xr-xsource/rvs-core/commit.d (renamed from etc/abomination/modules/rvs/commit.d)4
-rwxr-xr-xsource/rvs-core/commit.f (renamed from etc/abomination/modules/rvs/commit.f)4
-rwxr-xr-xsource/rvs-core/get (renamed from etc/abomination/modules/rvs/get)4
-rw-r--r--[-rwxr-xr-x]source/rvs-core/get.d (renamed from etc/abomination/modules/rvs/get.d)12
-rwxr-xr-xsource/rvs-core/get.f (renamed from etc/abomination/modules/rvs/get.f)4
-rwxr-xr-xsource/rvs-core/init (renamed from etc/abomination/modules/rvs/init)4
-rwxr-xr-xsource/rvs-core/lib/rvsdb (renamed from etc/abomination/modules/rvs/lib/rvsdb)18
-rwxr-xr-xsource/rvs-core/lib/stdio (renamed from etc/abomination/modules/rvs/lib/stdio)12
15 files changed, 318 insertions, 47 deletions
diff --git a/Makefile.bak b/Makefile.bak
new file mode 100644
index 0000000..979af8a
--- /dev/null
+++ b/Makefile.bak
@@ -0,0 +1,42 @@
+# rvs Makefile
+#
+# Copyright (C) 2009 Luke Shumaker
+# This program 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.
+#
+# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
+
+# Make Dependencies #################################################
+RM = rm -f
+WWW = links2 -width 70 -dump
+INSTALL = install
+
+# Variables ########################################################
+SHELL = $$SHELL$$
+prefix = $$prefix$$
+bindir = $$bindir$$
+libdir = $$libdir$$
+
+# Targets ##########################################################
+files
+build:
+# $(WWW) README.xhtml > README.txt
+
+.SUFFIXES:
+
+install : wrapper core
+ $(INSTALL) -m 755 -T out/rvs $(prefix)/$(bindir)/rvs
+ $(INSTALL) -m 755 -d out/rvs-core $(libdir)/core
+
+out/% : source/% var.sed
+ ./var.sed <$< > $@
+
+var.sed: makesed Variables
+ ./makesed <Variables > var.sed
+ chmod 755 var.sed
+
+clean:
+ $(RM) var.sed
+ $(RM) -r out
diff --git a/Makefile.orig b/Makefile.orig
new file mode 100644
index 0000000..3ea425e
--- /dev/null
+++ b/Makefile.orig
@@ -0,0 +1,55 @@
+# rvs Makefile
+#
+# Copyright (C) 2009 Luke Shumaker
+# This program 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.
+#
+# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
+
+
+# Make Dependencies #################################################
+RM = rm -f
+WWW = links2 -width 70 -dump
+INSTALL = install
+
+# Variables ########################################################
+SHELL = $$SHELL$$
+prefix = $$prefix$$
+bindir = $$bindir$$
+libdir = $$libdir$$
+
+# Targets ##########################################################
+rvs : wrapper core
+
+.SUFFIXES :
+
+#install : wrapper core
+# $(INSTALL) -m 755 -T out/rvs $(prefix)/$(bindir)/rvs
+# $(INSTALL) -m 755 -d out/rvs-core $(libdir)/core
+
+wrapper : lib out/rvs
+
+#core : l b c d p f s
+core : lib out/rvs-core/commit out/rvs-core/get d f
+
+#l: lib out/rvs-core/commit.l out/rvs-core/get.l
+#b: lib out/rvs-core/commit.b out/rvs-core/get.b
+#c: lib out/rvs-core/commit.c out/rvs-core/get.c
+d : lib out/rvs-core/commit.d out/rvs-core/get.d
+#p: lib out/rvs-core/commit.p out/rvs-core/get.p
+f : lib out/rvs-core/commit.f out/rvs-core/get.f
+#s: lib out/rvs-core/commit.s out/rvs-core/get.s
+#D: lib out/rvs-core/commit.D out/rvs-core/get.D
+
+lib: out/rvs-core/lib/stdio out/rvs-core/lib/rvsdb
+
+out/% : source/% tmp/var.sed
+ tmp/var.sed <$< > $@
+
+clean :
+ $(RM) -r tmp
+ $(RM) -r out
+ $(RM) Makefile
+
diff --git a/Variables b/Variables
new file mode 100644
index 0000000..dacb7a9
--- /dev/null
+++ b/Variables
@@ -0,0 +1,5 @@
+VER '0.6.0'
+SHELL '/usr/bin/env bash'
+prefix "$HOME"
+bindir 'bin'
+libdir '/etc/rvs/'
diff --git a/configure b/configure
new file mode 100755
index 0000000..35c7b76
--- /dev/null
+++ b/configure
@@ -0,0 +1,59 @@
+#!/bin/sh
+# rvs configureation script
+#
+# Copyright (C) 2009 Luke Shumaker
+# This program 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.
+#
+# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
+
+while [ $# -gt 0 ]; do case "$1" in
+ --*)
+ var0=`echo "$1" | sed -e 's/^--//' -e 's/=.*$//'`
+ match='false'
+ while read line; do
+ var1=`echo "$line" | cut -f 1 `
+ if [ "$var0" == "$var1" ]; then
+ match='true'
+ break;
+ fi
+ done < Variables
+ if [ "$match" == 'false' ]; then
+ echo "configure: option \`$1' not recognized"
+ exit 255;
+ else
+ val=`echo "$1" | sed -e "s/^--$var0=//"`
+ eval _$var0=$val
+ fi
+ :;;
+ *) echo "configure: option \`$1' not recognized"; exit 255;;
+ esac
+ shift
+done
+
+mkdir -p {out/rvs-core/lib,tmp}
+
+echo '#!/bin/sed -f' > tmp/var.sed
+while read line; do
+ var=`echo "$line" | cut -f 1 `
+ val=$(eval echo `echo "$line" | cut -f 2-`) # load from Variables file
+ val=$(eval echo '${'`echo _$var`-$val'}') # check for option overide
+
+ # evaluate the values, so that we may use env variables as values
+ # escape slashes, as they cause problems for sed
+ var=`echo "$var" | sed 's:/:\\\\/:g'`
+ val=`echo "$val" | sed 's:/:\\\\/:g'`
+
+ echo 's/$$'"${var}"'$\$/'"${val}"'/' >> tmp/var.sed
+ #sed -i.bak 's/$$'"${var}"'$\$/'"${val}"'/' "$files"
+ unset var val
+done < Variables
+
+chmod +x tmp/var.sed
+tmp/var.sed < Makefile.orig > Makefile
+
+n0='# DO NOT edit this file, it has been generated by configure, and will be'
+n1='# overwritten. Instead, edit the file `Makefile.orig'\'
+sed -i -e "10 a$n0" -e "10 a$n1" Makefile
diff --git a/docs/README.xhtml b/docs/README.xhtml
new file mode 100644
index 0000000..3d6c612
--- /dev/null
+++ b/docs/README.xhtml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>rvs $$VER$$</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+</head>
+<body>
+<h1>rvs $$VER$$</h1>
+<p>rvs is a basic versioning system I've been writing. If you don't know what that means, it isn't for you (at least not at this stage in development).</p>
+
+<h2>installation</h2>
+<p>After you have obtained the source code, cd into the directory and run:<code>
+<br />./configure
+<br />make install
+</code></p>
+<p>instead of using options to <kbd>./configure</kbd> like <samp>./configure --prefix=/usr/bin</samp>, all configuration options (that effect the installation, not the build process), are stored in the file <kbd>Variables</kbd>. Many of the source files use variables in the form <samp>$$VARNAME$$</samp>. The <kbd>./configure</kbd> script replaces each instance of this with the value defined in <kbd>Variables</kbd>. <kbd>Variables</kbd> contains a variable name, tab character, then value on each line.</p>
+
+<ul>
+ <li><kbd>/etc/abomination/modules/rvs/commit</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/commit.d</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/commit.f</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/get</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/get.d</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/get.f</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/init</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/lib/rvsdb</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/lib/stdio</kbd></li>
+ <li><kbd>/usr/bin/rvs</kbd></li>
+</ul>
+
+<h2>system requirements</h2>
+<p>Pretty much any *nix system should be able to run rvs, provided it has bash, and bash is installed at <kbd>/bin/bash</kbd> (e.g.: <a href="http://www.freebsd.org/">FreeBSD</a> has it at <kbd>/usr/bin/bash</kbd>, so you should set up a symlink). rvs is not designed for Windows, but should be able to run in bash if you have some *nix pack installed.</p>
+<p>To my knowledge, this is the absolute requirements (all need to be in your PATH):</p>
+<ul>
+ <li><a href="http://www.gnu.org/software/bash/">bash</a> (needs to be installed at <kbd>/bin/bash</kbd>)</li>
+ <li>cat (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>cp (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>cut (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>echo (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>mkdir (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>rm (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>sed (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>sha1sum (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>tempfile (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+ <li>tr (included in <a href="http://www.gnu.org/software/coreutils/">GNU Core Utils</a>)</li>
+</ul>
+
+<h2>usage</h2>
+<dl>
+ <dt>create repository in the current directory</dt>
+ <dd><kbd>rvs init</kbd></dd>
+ <dt>check in the current directory</dt>
+ <dd><kbd>rvs commit</kbd> This will return a commit id. You need this to check the revision back out.</dd>
+ <dt>check out to the current directory</dt>
+ <dd><kbd>rvs get <var>ID</var></kbd> This checks out commit <var>ID</var></dd>
+</dl>
+<p>The system will bork if you have filenames with spaces or newlines. Why? Because you haven't written a patch to fix it yet.</p>
+<p>Feel free to push to the <a href="https://code.launchpad.net/~lukeshu/+junk/rvs-release">launchpad repository</a>.</p>
+
+<h2>hacking</h2>
+<p>Again, here is a list of all files in <kbd>rvs-0.5.10.tar.gz</kbd>:</p>
+<ul>
+ <li><kbd>/etc/abomination/modules/rvs/commit</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/commit.d</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/commit.f</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/get</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/get.d</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/get.f</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/init</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/lib/rvsdb</kbd></li>
+ <li><kbd>/etc/abomination/modules/rvs/lib/stdio</kbd></li>
+ <li><kbd>/usr/bin/rvs</kbd></li>
+</ul>
+<p>These are all shell scripts and may be modified directly. I have designed this system to be extremely modular. As you may have figured out, each bit on functionality is in it's own script, and <kbd>/usr/bin/rvs</kbd> is just a wrapper for them. If you wish to move the directory with the sub-modules, all you have to do is update the variablle <code><var>RVSDIR</var></code> towards the beginning of <kbd>/usr/bin/rvs</kbd>.</p>
+<p><kbd>commit</kbd> actually does take a parameter. It can commit any file or directory. It works as it does because if no file is given, it defaults to <kbd>./</kbd>. If it is given a directory (as it is by default), it loops through each file in the directory and commits them (by calling itself). In order to actually commit a file or directory it calls <code>rvs commit.<var>type</var></code> where <var>type</var> is the standard unix file-type code:</p>
+
+<table>
+ <tr><td><pre><em>b</em>lock (buffered) special</pre></td><td>b</td></tr>
+ <tr><td><pre><em>c</em>haracter (unbuffered) special</pre></td><td>c</td></tr>
+ <tr><td><pre><em>d</em>irectory </pre></td><td>d</td></tr>
+ <tr><td><pre>named <em>p</em>ipe (FIFO) </pre></td><td>p</td></tr>
+ <tr><td><pre>regular <em>f</em>ile </pre></td><td>f</td></tr>
+ <tr><td><pre>symbolic <em>l</em>ink </pre></td><td>l</td></tr>
+ <tr><td><pre><em>d</em>ocket </pre></td><td>s</td></tr>
+ <tr><td><pre><em>d</em>oor (Solaris only) </pre></td><td>D</td></tr>
+</table>
+<p>As you probably noticed, only directories and regular files have been implemented in this release. <kbd>get</kbd> works in much the same way. If you implement any other file types, save the commit and get functions accordingly, and uncomment the line in <kbd>/etc/abomination/modules/rvs/commit</kbd>. Any commit function takes a filename as an argument and outputs the according commit id to stdout. Any get function takes the commit id as an argument and uses stdout only if verbose, or to report errors. So the modules communicate via pipes, which is generally considered bad-design, and libraries should be used. I deliberatly broke this because this way:</p>
+<ol>
+ <li>incompatible licences can be used for different modules</li>
+ <li>modules can be added/removed on the fly</li>
+ <li>one can use any lanugage to write new modules, without having to worry about bindings</li>
+</ol>
+
+<h3>TODO</h3>
+<ul>
+ <li>implment other unix file types (see above)</li>
+ <li>add real option handling (code from another project is provided in <kbd>/usr/bin/rvs</kbd>)</li>
+ <li>write real documentation</li>
+ <li>implment a parent/child tree<ul>
+ <li>implement branch ids (NOTE: <q>wch</q> should be used to refer to the latest commit in a branch)</li>
+ </ul></li>
+ <li>implement tags</li>
+ <li>owner/filepermissions/timestamps</li>
+ <li>usernames/author</li>
+</ul>
+
+<p>I have set up bazaar repository at <a href="https://code.launchpad.net/~lukeshu/+junk/rvs-release">Launchpad</a>. Only until rvs becomes self-hosting.</p>
+<p>If anyone needs any help, let me know.
+<br />~ Luke Shumaker &lt;<a href="mailto:lukeshu@sbcglobal.net">LukeShu@sbcglobal.net</a>&gt;
+<br />Happy Hacking!</p>
+</body>
+</html>
+
diff --git a/usr/bin/rvs b/source/rvs
index f8f31c6..6a6102a 100755
--- a/usr/bin/rvs
+++ b/source/rvs
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs
name='rvs'
ver='0.5.10'
@@ -11,7 +11,7 @@ usage='COMMAND [OPTIONS]'
#
# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
-RVSDIR='/etc/abomination/modules/rvs'
+RVSDIR='$$libdir$$'
source "$RVSDIR/lib/stdio"
source "$RVSDIR/lib/rvsdb"
diff --git a/etc/abomination/modules/rvs/commit b/source/rvs-core/commit
index 6ff39a0..2f120e0 100755
--- a/etc/abomination/modules/rvs/commit
+++ b/source/rvs-core/commit
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:commit
name='rvs commit'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS] [FILE]'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
@@ -23,15 +23,16 @@ fi
if [ ! -e $file]; then error "file \`$file' does not exist";
# START file type list
-#elif [ -b $file ]; type='b'; # block (buffered) special
-#elif [ -c $file ]; type='c'; # character (unbuffered) special
+elif [ -l $file ]; type='l'; # symbolic link
+elif [ -b $file ]; type='b'; # block (buffered) special
+elif [ -c $file ]; type='c'; # character (unbuffered) special
elif [ -d $file ]; type='d'; # directory
-#elif [ -p $file ]; type='p'; # named pipe (FIFO)
+elif [ -p $file ]; type='p'; # named pipe (FIFO)
elif [ -f $file ]; type='f'; # regular file
-#elif [ -l $file ]; type='l'; # symbolic link
-#elif [ -s $file ]; type='s'; # socket
+elif [ -s $file ]; type='s'; # socket
#elif [ -D $file ]; type='D'; # door (Solaris only)
# END file type list
+else error "could not identify file type of \`$file'"
fi
ret=`rvs "commit.$type" "$file"`
@@ -44,13 +45,6 @@ logwrite "$tmp" 'type' "$type"
logwrite "$tmp" 'author' "$user"
logwrite "$tmp" 'owner' "$owner"
logwrite "$tmp" 'owner' "$license"
-#parents=`logfind "$repo/co" "$file"` the checkout log is getting an overhaul
-#logwrite "$tmp" 'parents' "$parents"
-#case "$type" in
-# f)
-# #logwrite "$tmp" 'f.type' "$"
-# :;;
-#esac
rvs commit.f "$tmp"
rm "$tmp"
diff --git a/etc/abomination/modules/rvs/commit.d b/source/rvs-core/commit.d
index 91a75c4..5a47614 100755
--- a/etc/abomination/modules/rvs/commit.d
+++ b/source/rvs-core/commit.d
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:commit:d
name='rvs commit.d'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS] DIRECTORY'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
diff --git a/etc/abomination/modules/rvs/commit.f b/source/rvs-core/commit.f
index 78c5d59..cd8070b 100755
--- a/etc/abomination/modules/rvs/commit.f
+++ b/source/rvs-core/commit.f
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:commit:f
name='rvs commit.f'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS] FILE'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
diff --git a/etc/abomination/modules/rvs/get b/source/rvs-core/get
index dce3ac7..c1a2469 100755
--- a/etc/abomination/modules/rvs/get
+++ b/source/rvs-core/get
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:get
name='rvs commit'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS] ID [FILENAME]'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
diff --git a/etc/abomination/modules/rvs/get.d b/source/rvs-core/get.d
index 68d6aaa..dcd78e8 100755..100644
--- a/etc/abomination/modules/rvs/get.d
+++ b/source/rvs-core/get.d
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:get:d
name='rvs get.d'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS] ID FILENAME'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
@@ -22,11 +22,11 @@ tmp=`tempfile`
rvs get.f `logread "$db" 'hash'` "$tmp"
mkdir "$dir"
-for file in `cat "$tmp"`; do
- hash=`echo "$file" | sed 's/^.*://'`
- name=`echo "$file" | sed "s/:$hash$//"`
+while read line; do
+ hash=`echo "$line" | sed 's/^.*://'`
+ name=`echo "$line" | sed "s/:$hash$//"`
rvs get "$dir/$file"
-done
+done < "$tmp"
rm "$tmp"
diff --git a/etc/abomination/modules/rvs/get.f b/source/rvs-core/get.f
index a0db378..9e4cec7 100755
--- a/etc/abomination/modules/rvs/get.f
+++ b/source/rvs-core/get.f
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:get:f
name='rvs get.f'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS] ID FILENAME'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
diff --git a/etc/abomination/modules/rvs/init b/source/rvs-core/init
index ae778af..c0b5980 100755
--- a/etc/abomination/modules/rvs/init
+++ b/source/rvs-core/init
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination rvs init
name='rvs init'
-ver='0.5.10'
+ver='0.6.0'
usage='[OPTIONS]'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
diff --git a/etc/abomination/modules/rvs/lib/rvsdb b/source/rvs-core/lib/rvsdb
index 9763042..8cd4316 100755
--- a/etc/abomination/modules/rvs/lib/rvsdb
+++ b/source/rvs-core/lib/rvsdb
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:lib:rvsdb
#name='rvs db'
-#ver='0.5.10'
+#ver='0.6.0'
logver='0.5.0'
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
@@ -17,25 +17,25 @@ source "`rvs -d`/lib/stdio"
repo='.rvs'
# getid file
-function getid {
+getid() {
#md5sum $file | sed "s/ .*$//"
sha1sum $file | sed "s/ .*$//"
}
# loginit LOG
-function loginit {
+loginit() {
log="$1"
echo "#!rvsdb $logver" > "$log";
}
# lograw LOG
-function lograw {
+lograw() {
log="$1"
sed '1s/#!rvsdb .*//' "$log"
}
# _find LOG FIELD VAL
-function _find {
+_find() {
log="$1"
field="$2"
val="$3"
@@ -47,7 +47,7 @@ function _find {
}
# logread LOG VAR
-function logread {
+logread() {
log="$1"
var="$2"
lograw "$log" | sed -n "s/^$var://p"
@@ -55,7 +55,7 @@ function logread {
}
# logwrite LOG VAR VAL
-function logwrite {
+logwrite() {
log="$1"
var="$2"
val="$3"
@@ -73,7 +73,7 @@ function logwrite {
}
# logfind LOG VAL
-function logfind {
+logfind() {
log="$1"
val="$2"
# make a comma-delimeted list of the lines with our values
diff --git a/etc/abomination/modules/rvs/lib/stdio b/source/rvs-core/lib/stdio
index 8e11b72..9398a52 100755
--- a/etc/abomination/modules/rvs/lib/stdio
+++ b/source/rvs-core/lib/stdio
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!$$SHELL$$
# abomination module:rvs:lib:stdio
#name='rvs stdio'
-#ver='0.5.9'
+#ver='0.6.0'
#usage=''
# Copyright (C) 2009 Luke Shumaker
# This program is distributed in the hope that it will be useful,
@@ -17,19 +17,19 @@
sopt='VhH?vq'
lopt='version,verbose,quiet,help'
-function verbose {
+verbose() {
if [ "$volume" == '-v' ]; then
echo $@
fi
}
-function out {
+out() {
if [ "$volume" != '-q' ]; then
echo $@
fi
}
-function version {
+version() {
echo "$name $ver"
if [ "$volume" != '-q' ]; then
cat << __disclaimer__
@@ -45,7 +45,7 @@ __disclaimer__
exit 0
}
-function error {
+error() {
cat << __error__
$name: $1
Usage: $name $usage