summaryrefslogtreecommitdiff
path: root/modules/files
diff options
context:
space:
mode:
Diffstat (limited to 'modules/files')
l---------modules/files/Makefile1
-rw-r--r--modules/files/Makefile.inc.mk8
-rw-r--r--modules/files/Module.mk0
-rw-r--r--modules/files/_stdio.sh74
-rw-r--r--modules/files/blob-gethash.sh26
-rw-r--r--modules/files/blob-gettype.sh26
-rw-r--r--modules/files/commit.d.sh42
-rw-r--r--modules/files/commit.f.sh32
-rw-r--r--modules/files/commit.sh38
-rw-r--r--modules/files/file-gettype.sh39
-rw-r--r--modules/files/get.d.sh46
-rw-r--r--modules/files/get.f.sh29
-rw-r--r--modules/files/get.sh32
-rw-r--r--modules/files/ls.sh50
-rw-r--r--modules/files/print.sh39
-rw-r--r--modules/files/tree.sh40
16 files changed, 0 insertions, 522 deletions
diff --git a/modules/files/Makefile b/modules/files/Makefile
deleted file mode 120000
index fa7273c..0000000
--- a/modules/files/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../module.mk \ No newline at end of file
diff --git a/modules/files/Makefile.inc.mk b/modules/files/Makefile.inc.mk
deleted file mode 100644
index 99c739e..0000000
--- a/modules/files/Makefile.inc.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-src_files += blob-gethash.sh blob-gettype.sh commit.d.sh commit.f.sh commit.sh file-gettype.sh get.d.sh get.f.sh get.sh ls.sh print.sh tree.sh
-out_files += blob-gethash blob-gettype commit.d commit.f commit file-gettype get.d get.f get ls print tree
-
-src_files += _stdio.sh
-sys_files += $(pkglibexecdir)/modules/$(name)/_stdio.sh
-
-$(DESTDIR)$(pkglibexecdir)/modules/$(name)/_stdio.sh: $(srcdir)/_stdio.sh | $(DESTDIR)$(pkglibexecdir)/modules/$(name)
- $(INSTALL_DATA) $< $@
diff --git a/modules/files/Module.mk b/modules/files/Module.mk
deleted file mode 100644
index e69de29..0000000
--- a/modules/files/Module.mk
+++ /dev/null
diff --git a/modules/files/_stdio.sh b/modules/files/_stdio.sh
deleted file mode 100644
index 0da03f0..0000000
--- a/modules/files/_stdio.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-#name='stdio'
-#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 <http://www.gnu.org/licenses>.
-
-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: $RVS $name $usage
-
-Try \`$RVS help $name' for more options.
-__error__
- exit 1
-}
-
-getvar() {
- if [ -z "$1" ]; then
- error
- else
- echo $1
- fi
-}
-
-version() {
- echo "$name $ver"
- if [ "$volume" != '-q' ]; then
- cat << __disclaimer__
-$name is copyright (C) 2009-2010 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>.
-__disclaimer__
- fi
- exit 0
-}
-
diff --git a/modules/files/blob-gethash.sh b/modules/files/blob-gethash.sh
deleted file mode 100644
index 74a3f59..0000000
--- a/modules/files/blob-gethash.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-name='blob-gethash'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="ID"
-id="`getvar "$1"`"
-
-echo $id | sed 's/.*://'
-
diff --git a/modules/files/blob-gettype.sh b/modules/files/blob-gettype.sh
deleted file mode 100644
index 0dd924d..0000000
--- a/modules/files/blob-gettype.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-name='blob-gettype'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="ID"
-id="`getvar "$1"`"
-
-echo $id | sed 's/:.*//'
-
diff --git a/modules/files/commit.d.sh b/modules/files/commit.d.sh
deleted file mode 100644
index 67263ec..0000000
--- a/modules/files/commit.d.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-name='commit.d'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="DIRNAME"
-dir="`getvar "$1"`"
-
-tmp=`mktemp`
-t=' ';
-
-cd "$dir"
-for file in *; do
- p="`stat "$file" -c'%a' `" # permissions
- o="`stat "$file" -c'%u (%U)'`" # owner
- g="`stat "$file" -c'%g (%G)'`" # group
- i="`"$RVS" commit "$file"`" # ID
- n="$file" # name
-
- # %p %o %g %i %n
- echo "$p$t$o$t$g$t$i$t$n" >> "$tmp"
-done
-
-"$RVS" commit.f "$tmp" d
-rm "$tmp"
-
diff --git a/modules/files/commit.f.sh b/modules/files/commit.f.sh
deleted file mode 100644
index 4effab3..0000000
--- a/modules/files/commit.f.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-name='commit.f'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="FILENAME [TYPE]"
-file="`getvar "$1"`"
-prefix="${2-f}"
-
-hash=`sha1sum $file | sed "s/ .*$//"`
-if [ ! -f "$REPO/@ID@/$hash" ]; then
- mkdir -p "$REPO/@ID@/"
- install -m 644 -o $USER -g $USER -T "$file" "$REPO/@ID@/$hash"
-fi
-echo "$prefix:$hash"
-
diff --git a/modules/files/commit.sh b/modules/files/commit.sh
deleted file mode 100644
index 70573a6..0000000
--- a/modules/files/commit.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-# rvs inner.sh - The main RVS program
-# Copyright (C) 2009-2010, 2015 Luke Shumaker
-#
-# This file is part of rvs.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-. "$(dirname "$0")/_stdio.sh"
-
-if [[ $# -lt 1 ]]; then
- set -- .
-fi
-
-for file in "$@"; do
- local type
- if test -L "$file"; then
- type=l
- elif test -f "$file"; then
- type=f
- elif test -d "$file"; then
- type=d
- else
- error 'Unsupported file type: %s' "$file"
- fi
- "$RVS" "commit.$type" "$file"
-done
diff --git a/modules/files/file-gettype.sh b/modules/files/file-gettype.sh
deleted file mode 100644
index ac1ba4e..0000000
--- a/modules/files/file-gettype.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-name='file-gettype'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="FILE"
-file="`getvar "$1"`"
-
-if [ ! -e "$file" ]; then
- fatal "file \`$file' does not exist";
-else
- type=''
- for check in "$ETCDIR/@ID@/"*; do
- type=`"$check" "$file"`
- if [ -n "$type" ]; then break; fi
- done
- if [ -n "$type" ]; then
- echo "$type"
- else
- fatal "cannot handle file type of \`$file'"
- fi
-fi
-
diff --git a/modules/files/get.d.sh b/modules/files/get.d.sh
deleted file mode 100644
index 9aa493c..0000000
--- a/modules/files/get.d.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-name='get.d'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="DIRNAME ID"
-dir="`getvar "$1"`"
- id="`getvar "$2"`"
-
-tmp=`mktemp`
-"$RVS" get.f "$tmp" "$id"
-
-#install -d "$dir"
-mkdir -p "$dir"
-
-cd "$dir"
-rm -rf ./*
-while read line; do
- p="`echo "$line" | cut -f1`" # permissions
- o="`echo "$line" | cut -f2`" # owner
- g="`echo "$line" | cut -f3`" # group
- i="`echo "$line" | cut -f4`" # ID
- n="`echo "$line" | cut -f5-`" # name
- "$RVS" get "$n" "$i"
- chmod "$p" "$n"
- #chown "$o:$g" "$n"
-done < "$tmp"
-
-rm "$tmp"
-
diff --git a/modules/files/get.f.sh b/modules/files/get.f.sh
deleted file mode 100644
index d5d889d..0000000
--- a/modules/files/get.f.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-name='get.f'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="FILENAME ID"
-name="`getvar "$1"`"
- id="`getvar "$2"`"
-
-hash="`"$RVS" blob-gethash "$id"`"
-
-install -T "$REPO/@ID@/$hash" "$name"
-
diff --git a/modules/files/get.sh b/modules/files/get.sh
deleted file mode 100644
index 7dd0f1d..0000000
--- a/modules/files/get.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-name='get'
-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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="FILENAME ID"
-name="`getvar "$1"`"
- id="`getvar "$2"`"
-
-file="$REPO/@ID@/$id"
-
-type="`"$RVS" blob-gettype "$id"`"
-#hash="`"$RVS" blob-gethash "$id"`"
-
-"$RVS" "get.$type" "$name" "$id"
-
diff --git a/modules/files/ls.sh b/modules/files/ls.sh
deleted file mode 100644
index 1c4d620..0000000
--- a/modules/files/ls.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-name='ls'
-ver=0.1
-# Copyright (C) 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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="DIR_ID [FORMAT]"
-id="`getvar "$1"`"
-form="${2-%p\t%o\t%g\t%n\t%i}"
-
-# %p - permissions
-# %o - owner
-# %g - group
-# %i - blob id
-# %n - name
-# \t - a tab char
-
-tmp="`mktemp`"
-"$RVS" get.f "$tmp" "$id"
-
-while read line; do
- p="`echo "$line" | cut -f1`"
- o="`echo "$line" | cut -f2`"
- g="`echo "$line" | cut -f3`"
- i="`echo "$line" | cut -f4`"
- n="`echo "$line" | cut -f5-`"
- echo "$form" | sed \
- -e 's:\\t:\t:g' \
- -e "s:%p:${p/:/\\:}:g" \
- -e "s:%o:${o/:/\\:}:g" \
- -e "s:%g:${g/:/\\:}:g" \
- -e "s:%i:${i/:/\\:}:g" \
- -e "s:%n:${n/:/\\:}:g"
-done < "$tmp"
-
diff --git a/modules/files/print.sh b/modules/files/print.sh
deleted file mode 100644
index 9a03469..0000000
--- a/modules/files/print.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-name='print'
-ver=0.1
-# Copyright (C) 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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage='ID'
-id="`getvar "$1"`"
-
-hash="`"$RVS" blob-gethash "$id"`"
-file="$REPO/@ID@/$hash"
-
-if [ -e "$file" ]; then
- t="`"$RVS" blob-gettype "$id"`"
- type=''
- case "$t" in
- f) type='regular file';;
- d) type='directory';;
- esac
- echo "File Type: $t ($type)"
-else
- fatal "no object with ID \`$id'"
-fi
-
diff --git a/modules/files/tree.sh b/modules/files/tree.sh
deleted file mode 100644
index 4092582..0000000
--- a/modules/files/tree.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-name='tree'
-ver=0.1
-# Copyright (C) 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 <http://www.gnu.org/licenses>.
-
-. "$LIBDIR/@ID@/stdio"
-
-usage="DIR_ID [NAME] [PREFIX] [LAST]"
-id="`getvar "$1"`"
-name="${2-.}"
-pref="$3"
-last="$4"
-
-echo "$pref $name $id"
-pref=' | '
-"$RVS" ls "$id" '%i\t%n' | while read line; do
- i="`echo "$line" | cut -f1`"
- n="`echo "$line" | cut -f2-`"
- t="`"$RVS" blob-gettype "$i"`"
- if [ "$t" = 'd' ]
- "$RVS" tree "$i" "$n" "$pref"
- else
- echo "$pref $n $i"
- fi
-done
-