From 98f2efbe20e2d9d03e5296293cc8f52c95af72f5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 28 Mar 2010 12:25:08 -0400 Subject: Rework rvs a lot (no longer needs complex C dependency tracker!) Rework ./configure, and how it uses `srcdir'. Probably broke all the other packages. Oh well, everything only half-works right now. --- rvs/plugins/filedata/bin/commit | 33 +++++++++++++++++++ rvs/plugins/filedata/bin/commit.sh | 33 +++++++++++++++++++ rvs/plugins/filedata/bin/get | 23 +++++++++++++ rvs/plugins/filedata/bin/get.sh | 23 +++++++++++++ rvs/plugins/filedata/commit.sh | 33 ------------------- rvs/plugins/filedata/get.sh | 23 ------------- rvs/plugins/filedata/info.mk.in | 1 + rvs/plugins/filedata/plugin.conf.in | 4 --- rvs/plugins/files/bin/commit | 36 ++++++++++++++++++++ rvs/plugins/files/bin/commit.d.sh | 35 ++++++++++++++++++++ rvs/plugins/files/bin/commit.f.sh | 32 ++++++++++++++++++ rvs/plugins/files/bin/commit.sh | 36 ++++++++++++++++++++ rvs/plugins/files/bin/get.d.sh | 45 +++++++++++++++++++++++++ rvs/plugins/files/bin/get.f.sh | 27 +++++++++++++++ rvs/plugins/files/bin/get.sh | 34 +++++++++++++++++++ rvs/plugins/files/commit.d.sh | 35 -------------------- rvs/plugins/files/commit.f.sh | 32 ------------------ rvs/plugins/files/commit.sh | 41 ----------------------- rvs/plugins/files/etc/3-d.sh | 20 +++++++++++ rvs/plugins/files/etc/5-f.sh | 20 +++++++++++ rvs/plugins/files/get.d.sh | 45 ------------------------- rvs/plugins/files/get.f.sh | 27 --------------- rvs/plugins/files/get.sh | 34 ------------------- rvs/plugins/files/info.mk.in | 1 + rvs/plugins/files/lib/stdio.sh | 66 +++++++++++++++++++++++++++++++++++++ rvs/plugins/files/plugin.conf.in | 8 ----- rvs/plugins/files/stdio.sh | 66 ------------------------------------- rvs/plugins/main.mk.in | 31 ++++++++++++----- rvs/plugins/plugin.mk.in | 53 +++++++++++++++++------------ rvs/plugins/users/bin/commit.sh | 29 ++++++++++++++++ rvs/plugins/users/bin/init.sh | 28 ++++++++++++++++ rvs/plugins/users/bin/login.sh | 28 ++++++++++++++++ rvs/plugins/users/bin/logout.sh | 27 +++++++++++++++ rvs/plugins/users/bin/mkuser.sh | 29 ++++++++++++++++ rvs/plugins/users/bin/rmuser.sh | 28 ++++++++++++++++ rvs/plugins/users/commit.sh | 29 ---------------- rvs/plugins/users/init.sh | 28 ---------------- rvs/plugins/users/lib/stdio.sh | 66 +++++++++++++++++++++++++++++++++++++ rvs/plugins/users/login.sh | 28 ---------------- rvs/plugins/users/logout.sh | 27 --------------- rvs/plugins/users/mkuser.sh | 29 ---------------- rvs/plugins/users/plugin.conf.in | 7 ---- rvs/plugins/users/rmuser.sh | 28 ---------------- rvs/plugins/users/stdio.sh | 66 ------------------------------------- 44 files changed, 755 insertions(+), 619 deletions(-) create mode 100644 rvs/plugins/filedata/bin/commit create mode 100644 rvs/plugins/filedata/bin/commit.sh create mode 100644 rvs/plugins/filedata/bin/get create mode 100644 rvs/plugins/filedata/bin/get.sh delete mode 100644 rvs/plugins/filedata/commit.sh delete mode 100644 rvs/plugins/filedata/get.sh delete mode 100644 rvs/plugins/filedata/plugin.conf.in create mode 100644 rvs/plugins/files/bin/commit create mode 100644 rvs/plugins/files/bin/commit.d.sh create mode 100644 rvs/plugins/files/bin/commit.f.sh create mode 100644 rvs/plugins/files/bin/commit.sh create mode 100644 rvs/plugins/files/bin/get.d.sh create mode 100644 rvs/plugins/files/bin/get.f.sh create mode 100644 rvs/plugins/files/bin/get.sh delete mode 100644 rvs/plugins/files/commit.d.sh delete mode 100644 rvs/plugins/files/commit.f.sh delete mode 100644 rvs/plugins/files/commit.sh create mode 100644 rvs/plugins/files/etc/3-d.sh create mode 100644 rvs/plugins/files/etc/5-f.sh delete mode 100644 rvs/plugins/files/get.d.sh delete mode 100644 rvs/plugins/files/get.f.sh delete mode 100644 rvs/plugins/files/get.sh create mode 100644 rvs/plugins/files/lib/stdio.sh delete mode 100644 rvs/plugins/files/plugin.conf.in delete mode 100644 rvs/plugins/files/stdio.sh create mode 100644 rvs/plugins/users/bin/commit.sh create mode 100644 rvs/plugins/users/bin/init.sh create mode 100644 rvs/plugins/users/bin/login.sh create mode 100644 rvs/plugins/users/bin/logout.sh create mode 100644 rvs/plugins/users/bin/mkuser.sh create mode 100644 rvs/plugins/users/bin/rmuser.sh delete mode 100644 rvs/plugins/users/commit.sh delete mode 100644 rvs/plugins/users/init.sh create mode 100644 rvs/plugins/users/lib/stdio.sh delete mode 100644 rvs/plugins/users/login.sh delete mode 100644 rvs/plugins/users/logout.sh delete mode 100644 rvs/plugins/users/mkuser.sh delete mode 100644 rvs/plugins/users/plugin.conf.in delete mode 100644 rvs/plugins/users/rmuser.sh delete mode 100644 rvs/plugins/users/stdio.sh (limited to 'rvs/plugins') diff --git a/rvs/plugins/filedata/bin/commit b/rvs/plugins/filedata/bin/commit new file mode 100644 index 0000000..9b7f59a --- /dev/null +++ b/rvs/plugins/filedata/bin/commit @@ -0,0 +1,33 @@ +#!/bin/sh +name='rvs filedata commit' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +out="$1" +file="$2" +hash="`cat /dev/stdin`" + +temp=`mktemp` +echo "Hash: $hash" > "$temp" +stat "$file" >> "$temp" + +meta=`sha1sum "$temp" | sed "s/ .*$//"` +if [ ! -f "$REPO/@ID@/$hash" ]; then + install -m 644 -o $USER -g $USER -T "$temp" "$REPO/@ID@/$meta" +fi +echo "$meta" + diff --git a/rvs/plugins/filedata/bin/commit.sh b/rvs/plugins/filedata/bin/commit.sh new file mode 100644 index 0000000..9b7f59a --- /dev/null +++ b/rvs/plugins/filedata/bin/commit.sh @@ -0,0 +1,33 @@ +#!/bin/sh +name='rvs filedata commit' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +out="$1" +file="$2" +hash="`cat /dev/stdin`" + +temp=`mktemp` +echo "Hash: $hash" > "$temp" +stat "$file" >> "$temp" + +meta=`sha1sum "$temp" | sed "s/ .*$//"` +if [ ! -f "$REPO/@ID@/$hash" ]; then + install -m 644 -o $USER -g $USER -T "$temp" "$REPO/@ID@/$meta" +fi +echo "$meta" + diff --git a/rvs/plugins/filedata/bin/get b/rvs/plugins/filedata/bin/get new file mode 100644 index 0000000..321d5f8 --- /dev/null +++ b/rvs/plugins/filedata/bin/get @@ -0,0 +1,23 @@ +#!/bin/sh +name='rvs filedata get' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +out="$1" + +echo "yeah, this hasn't been coded yet, sorry!" + diff --git a/rvs/plugins/filedata/bin/get.sh b/rvs/plugins/filedata/bin/get.sh new file mode 100644 index 0000000..321d5f8 --- /dev/null +++ b/rvs/plugins/filedata/bin/get.sh @@ -0,0 +1,23 @@ +#!/bin/sh +name='rvs filedata get' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +out="$1" + +echo "yeah, this hasn't been coded yet, sorry!" + diff --git a/rvs/plugins/filedata/commit.sh b/rvs/plugins/filedata/commit.sh deleted file mode 100644 index f046db4..0000000 --- a/rvs/plugins/filedata/commit.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -name='rvs filedata commit' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -out="$1" -file="$2" -hash="`cat /dev/stdin`" - -temp=`mktemp` -echo "Hash: $hash" > "$temp" -stat "$file" >> "$temp" - -meta=`sha1sum $temp | sed "s/ .*$//"` -if [ ! -f "$REPO/@ID@/$hash" ]; then - install -m 644 -o $USER -g $USER -T "$temp" "$REPO/@ID@/$meta" -fi -echo "$meta" - diff --git a/rvs/plugins/filedata/get.sh b/rvs/plugins/filedata/get.sh deleted file mode 100644 index 321d5f8..0000000 --- a/rvs/plugins/filedata/get.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -name='rvs filedata get' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -out="$1" - -echo "yeah, this hasn't been coded yet, sorry!" - diff --git a/rvs/plugins/filedata/info.mk.in b/rvs/plugins/filedata/info.mk.in index 77643cd..0746843 100644 --- a/rvs/plugins/filedata/info.mk.in +++ b/rvs/plugins/filedata/info.mk.in @@ -1,2 +1,3 @@ name = filedata ver = 0.9 +priority = 1 diff --git a/rvs/plugins/filedata/plugin.conf.in b/rvs/plugins/filedata/plugin.conf.in deleted file mode 100644 index d7c834c..0000000 --- a/rvs/plugins/filedata/plugin.conf.in +++ /dev/null @@ -1,4 +0,0 @@ -# rvs @name@ plugins.conf -# ver=@ver@ -commit:repo-0.9/commit -get diff --git a/rvs/plugins/files/bin/commit b/rvs/plugins/files/bin/commit new file mode 100644 index 0000000..63eaac1 --- /dev/null +++ b/rvs/plugins/files/bin/commit @@ -0,0 +1,36 @@ +#!/bin/sh +name='rvs files commit' +ver=0.9 +# Copyright (C) 2009-2010 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +# commit FILE +file=${1-.} # take arg1 as the file, default to the current directory + +if [ ! -e "$file" ]; then + error "file \`$file' does not exist"; +else + foundMod='false'; + for type in select/*; do + if "$type" "$file"; then foundMod='true'; break; fi + done + if [ "$foundMod" == 'false' ]; then + error "cannot handle file type of \`$file'" + fi +fi + diff --git a/rvs/plugins/files/bin/commit.d.sh b/rvs/plugins/files/bin/commit.d.sh new file mode 100644 index 0000000..f5b432b --- /dev/null +++ b/rvs/plugins/files/bin/commit.d.sh @@ -0,0 +1,35 @@ +#!/bin/sh +name='rvs files commit.d' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +# commit.d DIRNAME +out="$1" +dir="$2" +tmp=`mktemp` + +cd "$dir" +for file in *; do + hash=`"$RVS" commit "$file"` + echo "$file:$hash" >> "$tmp" +done + +"$RVS" commit.f "$out" "$tmp" +rm "$tmp" + diff --git a/rvs/plugins/files/bin/commit.f.sh b/rvs/plugins/files/bin/commit.f.sh new file mode 100644 index 0000000..a86e5b5 --- /dev/null +++ b/rvs/plugins/files/bin/commit.f.sh @@ -0,0 +1,32 @@ +#!/bin/sh +name='rvs files commit.f' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +#source "$libexecdir/@ID@/stdio" + +# commit.f FILENAME +out="$1" +file="$2" + +#hash=`md5sum $file | sed "s/ .*$//"` +hash=`sha1sum $file | sed "s/ .*$//"` +if [ ! -f "$REPO/@ID@/$hash" ]; then + install -m 644 -o $USER -g $USER -T "$file" "$REPO/@ID@/$hash" +fi +echo "$hash" >> "$out" + diff --git a/rvs/plugins/files/bin/commit.sh b/rvs/plugins/files/bin/commit.sh new file mode 100644 index 0000000..63eaac1 --- /dev/null +++ b/rvs/plugins/files/bin/commit.sh @@ -0,0 +1,36 @@ +#!/bin/sh +name='rvs files commit' +ver=0.9 +# Copyright (C) 2009-2010 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +# commit FILE +file=${1-.} # take arg1 as the file, default to the current directory + +if [ ! -e "$file" ]; then + error "file \`$file' does not exist"; +else + foundMod='false'; + for type in select/*; do + if "$type" "$file"; then foundMod='true'; break; fi + done + if [ "$foundMod" == 'false' ]; then + error "cannot handle file type of \`$file'" + fi +fi + diff --git a/rvs/plugins/files/bin/get.d.sh b/rvs/plugins/files/bin/get.d.sh new file mode 100644 index 0000000..46e1eeb --- /dev/null +++ b/rvs/plugins/files/bin/get.d.sh @@ -0,0 +1,45 @@ +#!/bin/sh +name='rvs files get.d' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +#source "$libexecdir/@ID@/stdio" + +# get.d ID DIRNAME +id="$1" +dir="$2" + +tmp=`mktemp` +"$RVS" get.f "$id" "$tmp" + +#install -d "$dir" +mkdir -p "$dir" + +cd "$dir" +rm -rf ./* +while read line; do + # GNU bash optimized version + #hash=${line/#*:/} + #name=${line/%:${hash}/} + # POSIX version + hash=`echo "$line" | sed 's/^.*://'` + name=`echo "$line" | sed "s/:$hash$//"` + "$RVS" get "$hash" "$name" +done < "$tmp" + +rm "$tmp" + diff --git a/rvs/plugins/files/bin/get.f.sh b/rvs/plugins/files/bin/get.f.sh new file mode 100644 index 0000000..e6b79d5 --- /dev/null +++ b/rvs/plugins/files/bin/get.f.sh @@ -0,0 +1,27 @@ +#!/bin/sh +name='rvs files get.f' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +#source "$libexecdir/@ID@/stdio" + +# get.f ID FILENAME +id="$1" +file="$2" + +install -T "$REPO/@ID@/$id" "$file" + diff --git a/rvs/plugins/files/bin/get.sh b/rvs/plugins/files/bin/get.sh new file mode 100644 index 0000000..4d0d48f --- /dev/null +++ b/rvs/plugins/files/bin/get.sh @@ -0,0 +1,34 @@ +#!/bin/sh +name='rvs files get' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +# get ID [FILE] +id="$1" +tmp=`mktemp` +"$RVS" get.f "$id" "$tmp" +type="`sed -n 's/^type://p' "$tmp"`" +file="${2-`sed -n 's/^name://p' "$tmp"`}" +hash="`sed -n 's/^hash://p' "$tmp"`" + +out "-$type `pwd`/$file" +"$RVS" get.$type "$hash" "$file" + +rm "$tmp" + diff --git a/rvs/plugins/files/commit.d.sh b/rvs/plugins/files/commit.d.sh deleted file mode 100644 index f5b432b..0000000 --- a/rvs/plugins/files/commit.d.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -name='rvs files commit.d' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -# commit.d DIRNAME -out="$1" -dir="$2" -tmp=`mktemp` - -cd "$dir" -for file in *; do - hash=`"$RVS" commit "$file"` - echo "$file:$hash" >> "$tmp" -done - -"$RVS" commit.f "$out" "$tmp" -rm "$tmp" - diff --git a/rvs/plugins/files/commit.f.sh b/rvs/plugins/files/commit.f.sh deleted file mode 100644 index a86e5b5..0000000 --- a/rvs/plugins/files/commit.f.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -name='rvs files commit.f' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -#source "$libexecdir/@ID@/stdio" - -# commit.f FILENAME -out="$1" -file="$2" - -#hash=`md5sum $file | sed "s/ .*$//"` -hash=`sha1sum $file | sed "s/ .*$//"` -if [ ! -f "$REPO/@ID@/$hash" ]; then - install -m 644 -o $USER -g $USER -T "$file" "$REPO/@ID@/$hash" -fi -echo "$hash" >> "$out" - diff --git a/rvs/plugins/files/commit.sh b/rvs/plugins/files/commit.sh deleted file mode 100644 index 32d3042..0000000 --- a/rvs/plugins/files/commit.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -name='rvs files commit' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -# commit FILE -file=${1-.} - -if [ ! -e $file ]; then error "file \`$file' does not exist"; -# START file type list -elif [ -L $file ]; then type='l'; # symbolic link -elif [ -b $file ]; then type='b'; # block (buffered) special -elif [ -c $file ]; then type='c'; # character (unbuffered) special -elif [ -d $file ]; then type='d'; # directory -elif [ -p $file ]; then type='p'; # named pipe (FIFO) -elif [ -f $file ]; then type='f'; # regular file -elif [ -s $file ]; then type='s'; # socket -#elif [ -D $file ]; then type='D'; # door (Solaris only) -# END file type list -else error "could not identify file type of \`$file'" -fi - -out "+$type `pwd`/$file" -"$RVS" commit.$type "$file" - diff --git a/rvs/plugins/files/etc/3-d.sh b/rvs/plugins/files/etc/3-d.sh new file mode 100644 index 0000000..91163dc --- /dev/null +++ b/rvs/plugins/files/etc/3-d.sh @@ -0,0 +1,20 @@ +#!/bin/sh +#name='' +#ver=0.9 +# Copyright (C) 2009-2010 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +if [ -f $file ]; then echo 'd'; fi diff --git a/rvs/plugins/files/etc/5-f.sh b/rvs/plugins/files/etc/5-f.sh new file mode 100644 index 0000000..975992a --- /dev/null +++ b/rvs/plugins/files/etc/5-f.sh @@ -0,0 +1,20 @@ +#!/bin/sh +#name='' +#ver=0.9 +# Copyright (C) 2009-2010 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +if [ -f $file ]; then echo 'f'; fi diff --git a/rvs/plugins/files/get.d.sh b/rvs/plugins/files/get.d.sh deleted file mode 100644 index 46e1eeb..0000000 --- a/rvs/plugins/files/get.d.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -name='rvs files get.d' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -#source "$libexecdir/@ID@/stdio" - -# get.d ID DIRNAME -id="$1" -dir="$2" - -tmp=`mktemp` -"$RVS" get.f "$id" "$tmp" - -#install -d "$dir" -mkdir -p "$dir" - -cd "$dir" -rm -rf ./* -while read line; do - # GNU bash optimized version - #hash=${line/#*:/} - #name=${line/%:${hash}/} - # POSIX version - hash=`echo "$line" | sed 's/^.*://'` - name=`echo "$line" | sed "s/:$hash$//"` - "$RVS" get "$hash" "$name" -done < "$tmp" - -rm "$tmp" - diff --git a/rvs/plugins/files/get.f.sh b/rvs/plugins/files/get.f.sh deleted file mode 100644 index e6b79d5..0000000 --- a/rvs/plugins/files/get.f.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -name='rvs files get.f' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -#source "$libexecdir/@ID@/stdio" - -# get.f ID FILENAME -id="$1" -file="$2" - -install -T "$REPO/@ID@/$id" "$file" - diff --git a/rvs/plugins/files/get.sh b/rvs/plugins/files/get.sh deleted file mode 100644 index 4d0d48f..0000000 --- a/rvs/plugins/files/get.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -name='rvs files get' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -# get ID [FILE] -id="$1" -tmp=`mktemp` -"$RVS" get.f "$id" "$tmp" -type="`sed -n 's/^type://p' "$tmp"`" -file="${2-`sed -n 's/^name://p' "$tmp"`}" -hash="`sed -n 's/^hash://p' "$tmp"`" - -out "-$type `pwd`/$file" -"$RVS" get.$type "$hash" "$file" - -rm "$tmp" - diff --git a/rvs/plugins/files/info.mk.in b/rvs/plugins/files/info.mk.in index d7ccb97..7552306 100644 --- a/rvs/plugins/files/info.mk.in +++ b/rvs/plugins/files/info.mk.in @@ -1,2 +1,3 @@ name = files ver = 0.9 +priority = 0 diff --git a/rvs/plugins/files/lib/stdio.sh b/rvs/plugins/files/lib/stdio.sh new file mode 100644 index 0000000..9062683 --- /dev/null +++ b/rvs/plugins/files/lib/stdio.sh @@ -0,0 +1,66 @@ +#!/bin/sh +#name='rvs files stdio' +#ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +verbose() { + if [ "$volume" == '-v' ]; then + echo $@ >> /dev/stderr + fi +} + +out() { + if [ "$volume" != '-q' ]; then + echo $@ >> /dev/stderr + fi +} + +warn () { + echo "$name: $1" >> /dev/stderr +} + +fatal () { + warn "$1" + exit 1 +} + +error() { + warn "$1" + cat << __error__ >> /dev/stderr +Usage: $name $usage + +Try \`$name --help\' for more options. +__error__ + exit 1 +} + +version() { + echo "$name $ver" + if [ "$volume" != '-q' ]; then + cat << __disclaimer__ +$name is 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 . +__disclaimer__ + fi + exit 0 +} + diff --git a/rvs/plugins/files/plugin.conf.in b/rvs/plugins/files/plugin.conf.in deleted file mode 100644 index 2359dd5..0000000 --- a/rvs/plugins/files/plugin.conf.in +++ /dev/null @@ -1,8 +0,0 @@ -# rvs @name@ plugins.conf -# ver=@ver@ -commit -commit.d -commit.f -get -get.d -get.f diff --git a/rvs/plugins/files/stdio.sh b/rvs/plugins/files/stdio.sh deleted file mode 100644 index 9062683..0000000 --- a/rvs/plugins/files/stdio.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -#name='rvs files stdio' -#ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -verbose() { - if [ "$volume" == '-v' ]; then - echo $@ >> /dev/stderr - fi -} - -out() { - if [ "$volume" != '-q' ]; then - echo $@ >> /dev/stderr - fi -} - -warn () { - echo "$name: $1" >> /dev/stderr -} - -fatal () { - warn "$1" - exit 1 -} - -error() { - warn "$1" - cat << __error__ >> /dev/stderr -Usage: $name $usage - -Try \`$name --help\' for more options. -__error__ - exit 1 -} - -version() { - echo "$name $ver" - if [ "$volume" != '-q' ]; then - cat << __disclaimer__ -$name is 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 . -__disclaimer__ - fi - exit 0 -} - diff --git a/rvs/plugins/main.mk.in b/rvs/plugins/main.mk.in index f0401d1..3039c1f 100644 --- a/rvs/plugins/main.mk.in +++ b/rvs/plugins/main.mk.in @@ -17,22 +17,37 @@ # along with this program; see the file COPYING. # If not, see . +sysconfdir ?= @sysconfdir@ +BINDIR ?= @BINDIR@ +TMPDIR ?= @TMPDIR@ +LIBDIR ?= @LIBDIR@ +ETCDIR ?= @ETCDIR@ +dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR) + mods = $(patsubst ./%,%,$(shell find ./* -maxdepth 0 -type d)) +mods-build = $(addprefix build-,$(mods)) +mods-install = $(addprefix install-,$(mods)) +mods-clean = $(addprefix clean-,$(mods)) +mods-distclean = $(addprefix distclean-,$(mods)) .PHONY : all all : build -.PHONY : install build -install : $(addprefix install-,$(mods)) -build : $(addprefix build-,$(mods)) +.PHONY : build install clean distclean +# $(mods-build) $(mods-install) $(mods-clean) $(mods-distclean) +build : $(mods-build) +install : $(mods-install) +clean : $(mods-clean) +distclean : $(mods-distclean) + $(RM) Makefile *.mk .SECONDARY: %/main.mk : plugin.mk %/; cp $< $@ -complete-% : %/ %/main.mk; : -build-% : %/ complete-% %/main.mk; $(MAKE) -C $< -install-% : %/ complete-% %/main.mk; $(MAKE) -C $< install -clean-% : %/ complete-% %/main.mk; $(MAKE) -C $< clean -distclean-% : %/ complete-% %/main.mk; $(MAKE) -C $< distclean +complete-% : %/ %/main.mk; : +build-% : %/ complete-% %/main.mk; $(MAKE) -C $< +install-% : %/ complete-% %/main.mk; $(MAKE) -C $< install +clean-% : %/ complete-% %/main.mk; -$(MAKE) -C $< clean +distclean-% : %/ complete-% %/main.mk; $(MAKE) -C $< distclean diff --git a/rvs/plugins/plugin.mk.in b/rvs/plugins/plugin.mk.in index 6980538..8af5fcc 100644 --- a/rvs/plugins/plugin.mk.in +++ b/rvs/plugins/plugin.mk.in @@ -18,37 +18,51 @@ include info.mk # this contains the actuall name/version for the plugin # along with this program; see the file COPYING. # If not, see . +sysconfdir ?= @sysconfdir@ +BINDIR ?= @BINDIR@ +TMPDIR ?= @TMPDIR@ +LIBDIR ?= @LIBDIR@ +ETCDIR ?= @ETCDIR@ +dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR) + rvs = @name@ id = $(name)-$(ver) # phony targets #################################################### all : $(name) -.PHONY : $(name) install uninstall clean distclean dist +.PHONY : $(name) install uninstall clean distclean .SUFFIXES : # build ############################################################ -mysrcdir = $(srcdir)/plugins/$(name) -myoutdir = out +$(info srcdir:$(srcdir)) -srcFiles = $(filter-out %/Makefile.in,$(shell find $(mysrcdir)/ -type f)) +srcFiles = $(filter-out %/Makefile.in,$(shell find $(srcdir)/ -type f)) shSrcFiles = $(filter %.sh,$(srcFiles)) -shOutFiles = $(patsubst $(mysrcdir)/%,$(myoutdir)/%,$(basename $(shSrcFiles))) +shOutFiles = $(patsubst $(srcdir)/%,%,$(basename $(shSrcFiles))) -$(name) : $(myoutdir) $(shOutFiles) $(myoutdir)/plugin.conf - -$(myoutdir)/plugin.conf : $(mysrcdir)/plugin.conf.in - $(INSTALL_DATA) $< $@ - $(SED) -i \ - -e 's/$bname@/$(subst /,\/,$(name))/g' \ - -e 's/$bver@/$(subst /,\/,$(ver))/g' \ - $@ +outFiles = $(shOutFiles) +outBin = $(addprefix bin-,$(notdir $(filter bin/%,$(outFiles)))) +outEtc = $(addprefix $(ETCDIR)/$(name),$(notdir $(filter etc/%,$(outFiles)))) +outLib = $(addprefix $(LIBDIR)/$(name),$(notdir $(filter lib/%,$(outFiles)))) +$(name) : $(myoutdir) $(shOutFiles) # (un)install ###################################################### -install : all - $(RVS) install $(name)-$(ver) $(myoutdir) +install : $(outBin) $(outEtc) $(outLib) + +unbin-% : bin/% + $(RVS) uninstall $(notdir $<) $(name) + +bin-% : bin/% + $(RVS) install $< $(notdir $<) $(name) $(priority) + +$(ECTDIR)/$(name)/% : etc/% + $(CP) $< $@ + +$(LIBDIR)/$(name)/% : lib/% + $(CP) $< $@ uninstall : $(RVS) uninstall $(name) @@ -58,14 +72,14 @@ uninstall : clean : distclean : clean - $(RM) Makefile - $(RM) -r out + find ./ -name Makefile -exec $(RM) '{}' \; + find ./ -name '*.mk' -exec $(RM) '{}' \; # implicit rules ################################################### b := @ # build shell scripts -$(myoutdir)/% : $(mysrcdir)/%.sh $(myoutdir) +% : %.sh $(INSTALL_PROGRAM) $< $@ $(SED) -i \ -e 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' \ @@ -73,6 +87,3 @@ $(myoutdir)/% : $(mysrcdir)/%.sh $(myoutdir) -e 's/$bID@/$(subst /,\/,$(id))/g' \ $@ -$(DESTDIR)$(libexecdir)/$(rvs) $(myoutdir) : - $(MKDIR) $@ - diff --git a/rvs/plugins/users/bin/commit.sh b/rvs/plugins/users/bin/commit.sh new file mode 100644 index 0000000..1fa2e52 --- /dev/null +++ b/rvs/plugins/users/bin/commit.sh @@ -0,0 +1,29 @@ +#!/bin/sh +name='rvs users commit' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +ret=`$RVS repo-0.7beta/commit $@` +if [ -f "$REPO/@ID@/user" ]; then + cp "$REPO/@ID@/user" "$REPO/@ID@/repo/$ret" + echo "$ret" +else + error 'you must be logged in to commit files' +fi + diff --git a/rvs/plugins/users/bin/init.sh b/rvs/plugins/users/bin/init.sh new file mode 100644 index 0000000..142f54c --- /dev/null +++ b/rvs/plugins/users/bin/init.sh @@ -0,0 +1,28 @@ +#!/bin/sh +name='rvs users init' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +#source "$libexecdir/@ID@/stdio" + +mkdir -p "$REPO/@ID@"/{users,repo} +cat << __EOF__ > "$REPO/@ID@/users/Public Domain" +author:anonymous +owner:Public Domain +license: +__EOF__ + diff --git a/rvs/plugins/users/bin/login.sh b/rvs/plugins/users/bin/login.sh new file mode 100644 index 0000000..40a5830 --- /dev/null +++ b/rvs/plugins/users/bin/login.sh @@ -0,0 +1,28 @@ +#!/bin/sh +name='rvs users login' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +user="$1" +if [ -f "$REPO/@ID@/users/$user" ]; then + install -m 644 -T "$REPO/@ID@/users/$user" "$REPO/@ID@/../user" +else + error "User \`$user' does not exist" +fi + diff --git a/rvs/plugins/users/bin/logout.sh b/rvs/plugins/users/bin/logout.sh new file mode 100644 index 0000000..260846e --- /dev/null +++ b/rvs/plugins/users/bin/logout.sh @@ -0,0 +1,27 @@ +#!/bin/sh +name='rvs users logout' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +if [ -f "$REPO/@ID@/../user" ]; then + rm "$REPO/@ID@/../user" +else + error 'you must be logged in to logout' +fi + diff --git a/rvs/plugins/users/bin/mkuser.sh b/rvs/plugins/users/bin/mkuser.sh new file mode 100644 index 0000000..6f72ea9 --- /dev/null +++ b/rvs/plugins/users/bin/mkuser.sh @@ -0,0 +1,29 @@ +#!/bin/sh +name='rvs users mkuser' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This file is part of rvs. +# +# rvs 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 2, or (at your option) any later version. +# +# rvs 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 rvs; see the file COPYING. +# If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +source "$libexecdir/@ID@/stdio" + +author="$1" +touch "$REPO/@ID@/users/$author" +cat << __EOF__ > "$REPO/@ID@/users/$author" +author:$author +__EOF__ + diff --git a/rvs/plugins/users/bin/rmuser.sh b/rvs/plugins/users/bin/rmuser.sh new file mode 100644 index 0000000..604f359 --- /dev/null +++ b/rvs/plugins/users/bin/rmuser.sh @@ -0,0 +1,28 @@ +#!/bin/sh +name='rvs users rmuser' +ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +source "$libexecdir/@ID@/stdio" + +user="$1" +if [ -f "$REPO/@ID@/users/$user" ]; then + rm "$REPO/@ID@/users/$user" +else + error "User \`$user' does not exist" +fi + diff --git a/rvs/plugins/users/commit.sh b/rvs/plugins/users/commit.sh deleted file mode 100644 index 1fa2e52..0000000 --- a/rvs/plugins/users/commit.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -name='rvs users commit' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -ret=`$RVS repo-0.7beta/commit $@` -if [ -f "$REPO/@ID@/user" ]; then - cp "$REPO/@ID@/user" "$REPO/@ID@/repo/$ret" - echo "$ret" -else - error 'you must be logged in to commit files' -fi - diff --git a/rvs/plugins/users/init.sh b/rvs/plugins/users/init.sh deleted file mode 100644 index 142f54c..0000000 --- a/rvs/plugins/users/init.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -name='rvs users init' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -#source "$libexecdir/@ID@/stdio" - -mkdir -p "$REPO/@ID@"/{users,repo} -cat << __EOF__ > "$REPO/@ID@/users/Public Domain" -author:anonymous -owner:Public Domain -license: -__EOF__ - diff --git a/rvs/plugins/users/lib/stdio.sh b/rvs/plugins/users/lib/stdio.sh new file mode 100644 index 0000000..edf7c01 --- /dev/null +++ b/rvs/plugins/users/lib/stdio.sh @@ -0,0 +1,66 @@ +#!/bin/sh +#name='rvs users stdio' +#ver=0.9 +# Copyright (C) 2009 Luke Shumaker +# +# This program 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 2 of the +# License, or (at your option) any later version. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, see . + +verbose() { + if [ "$volume" == '-v' ]; then + echo $@ >> /dev/stderr + fi +} + +out() { + if [ "$volume" != '-q' ]; then + echo $@ + fi +} + +warn () { + echo "$name: $1" >> /dev/stderr +} + +fatal () { + warn "$1" + exit 1 +} + +error() { + warn "$1" + cat << __error__ >> /dev/stderr +Usage: $name $usage + +Try \`$name --help\' for more options. +__error__ + exit 1 +} + +version() { + echo "$name $ver" + if [ "$volume" != '-q' ]; then + cat << __disclaimer__ +$name is 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 . +__disclaimer__ + fi + exit 0 +} + diff --git a/rvs/plugins/users/login.sh b/rvs/plugins/users/login.sh deleted file mode 100644 index 40a5830..0000000 --- a/rvs/plugins/users/login.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -name='rvs users login' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -user="$1" -if [ -f "$REPO/@ID@/users/$user" ]; then - install -m 644 -T "$REPO/@ID@/users/$user" "$REPO/@ID@/../user" -else - error "User \`$user' does not exist" -fi - diff --git a/rvs/plugins/users/logout.sh b/rvs/plugins/users/logout.sh deleted file mode 100644 index 260846e..0000000 --- a/rvs/plugins/users/logout.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -name='rvs users logout' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -if [ -f "$REPO/@ID@/../user" ]; then - rm "$REPO/@ID@/../user" -else - error 'you must be logged in to logout' -fi - diff --git a/rvs/plugins/users/mkuser.sh b/rvs/plugins/users/mkuser.sh deleted file mode 100644 index 6f72ea9..0000000 --- a/rvs/plugins/users/mkuser.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -name='rvs users mkuser' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This file is part of rvs. -# -# rvs 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 2, or (at your option) any later version. -# -# rvs 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 rvs; see the file COPYING. -# If not, write to the Free Software Foundation, -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -source "$libexecdir/@ID@/stdio" - -author="$1" -touch "$REPO/@ID@/users/$author" -cat << __EOF__ > "$REPO/@ID@/users/$author" -author:$author -__EOF__ - diff --git a/rvs/plugins/users/plugin.conf.in b/rvs/plugins/users/plugin.conf.in deleted file mode 100644 index 9b1b35c..0000000 --- a/rvs/plugins/users/plugin.conf.in +++ /dev/null @@ -1,7 +0,0 @@ -# rvs @name@ plugins.conf -# ver=@ver@ -commit:repo-0.9/commit -login -logout -mkuser -rmuser diff --git a/rvs/plugins/users/rmuser.sh b/rvs/plugins/users/rmuser.sh deleted file mode 100644 index 604f359..0000000 --- a/rvs/plugins/users/rmuser.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -name='rvs users rmuser' -ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -source "$libexecdir/@ID@/stdio" - -user="$1" -if [ -f "$REPO/@ID@/users/$user" ]; then - rm "$REPO/@ID@/users/$user" -else - error "User \`$user' does not exist" -fi - diff --git a/rvs/plugins/users/stdio.sh b/rvs/plugins/users/stdio.sh deleted file mode 100644 index edf7c01..0000000 --- a/rvs/plugins/users/stdio.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -#name='rvs users stdio' -#ver=0.9 -# Copyright (C) 2009 Luke Shumaker -# -# This program 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 2 of the -# License, or (at your option) any later version. -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, see . - -verbose() { - if [ "$volume" == '-v' ]; then - echo $@ >> /dev/stderr - fi -} - -out() { - if [ "$volume" != '-q' ]; then - echo $@ - fi -} - -warn () { - echo "$name: $1" >> /dev/stderr -} - -fatal () { - warn "$1" - exit 1 -} - -error() { - warn "$1" - cat << __error__ >> /dev/stderr -Usage: $name $usage - -Try \`$name --help\' for more options. -__error__ - exit 1 -} - -version() { - echo "$name $ver" - if [ "$volume" != '-q' ]; then - cat << __disclaimer__ -$name is 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 . -__disclaimer__ - fi - exit 0 -} - -- cgit v1.2.3-2-g168b