diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-07-01 23:22:00 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-07-01 23:22:00 -0600 |
commit | 504d11ded8c1e9a0757332f2a10ed7d86dd5fc70 (patch) | |
tree | a3bba73ac491feaaecddca3345d8a54c5673bf72 /modules/tags | |
parent | 04b12bbea2be03a988e773afcd014a74d37ddca5 (diff) |
A whole bunch of stuff
Diffstat (limited to 'modules/tags')
l--------- | modules/tags/Makefile | 1 | ||||
-rw-r--r-- | modules/tags/Makefile.inc.mk | 2 | ||||
-rw-r--r-- | modules/tags/Module.mk | 2 | ||||
-rw-r--r-- | modules/tags/commit.sh | 24 | ||||
-rw-r--r-- | modules/tags/get-tag.sh | 25 | ||||
-rw-r--r-- | modules/tags/print.sh | 30 | ||||
-rw-r--r-- | modules/tags/tag-id.sh | 33 | ||||
-rw-r--r-- | modules/tags/tag.sh | 28 |
8 files changed, 145 insertions, 0 deletions
diff --git a/modules/tags/Makefile b/modules/tags/Makefile new file mode 120000 index 0000000..fa7273c --- /dev/null +++ b/modules/tags/Makefile @@ -0,0 +1 @@ +../module.mk
\ No newline at end of file diff --git a/modules/tags/Makefile.inc.mk b/modules/tags/Makefile.inc.mk new file mode 100644 index 0000000..8d687a5 --- /dev/null +++ b/modules/tags/Makefile.inc.mk @@ -0,0 +1,2 @@ +src_files += commit.sh get-tag.sh print.sh tag-id.sh tag.sh +out_files += commit get-tag print tag-id tag diff --git a/modules/tags/Module.mk b/modules/tags/Module.mk new file mode 100644 index 0000000..fd9e5f7 --- /dev/null +++ b/modules/tags/Module.mk @@ -0,0 +1,2 @@ +commit/tags :: commit/files + diff --git a/modules/tags/commit.sh b/modules/tags/commit.sh new file mode 100644 index 0000000..9282a11 --- /dev/null +++ b/modules/tags/commit.sh @@ -0,0 +1,24 @@ +#!/bin/sh +name='rvs @ID@ commit' +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>. + +if [ "$RVS_LEVEL" = '0' ]; then + id=`cat "$TMPDIR/commit/files"` + "$RVS" tag "$id" wch +fi + diff --git a/modules/tags/get-tag.sh b/modules/tags/get-tag.sh new file mode 100644 index 0000000..fa7895b --- /dev/null +++ b/modules/tags/get-tag.sh @@ -0,0 +1,25 @@ +#!/bin/sh +name='rvs @ID@ get-tag' +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>. + +usage="usage: $RVS get-tag FILENAME TAG" +name="${1?"$usage"}" + tag="${2?"$usage"}" + +"$RVS" get "$name" "`"$RVS" tag-id "$tag"`" + diff --git a/modules/tags/print.sh b/modules/tags/print.sh new file mode 100644 index 0000000..b7bc1c5 --- /dev/null +++ b/modules/tags/print.sh @@ -0,0 +1,30 @@ +#!/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>. + +usage="Usage: $RVS $name ID" +id="${1?"$usage"}" + +dir="$REPO/@ID@" +if [ -d "$dir" ]; then + cd "$dir" + echo "Tags:" + grep -rFxl "$id" ./ | sed 's/^\.\/\(.*\)/ \1/' +fi + + diff --git a/modules/tags/tag-id.sh b/modules/tags/tag-id.sh new file mode 100644 index 0000000..ef95f69 --- /dev/null +++ b/modules/tags/tag-id.sh @@ -0,0 +1,33 @@ +#!/bin/sh +name='tag-id' +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>. + +usage="usage: $RVS $name TAG" +tag="${1?"$usage"}" + +file="$REPO/@ID@/$tag" + +if [ -f "$file" ]; then + cat "$REPO/@ID@/$tag" +else + echo "$0: cannot find tag \`$tag'" >> /dev/stderr + exit 1 +fi + + + diff --git a/modules/tags/tag.sh b/modules/tags/tag.sh new file mode 100644 index 0000000..bc3f546 --- /dev/null +++ b/modules/tags/tag.sh @@ -0,0 +1,28 @@ +#!/bin/sh +name='rvs @ID@ tag' +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>. + +# tag ID TAG +usage="usage: $RVS tag ID TAG" + ID="${1?"$usage"}" +tag="${2?"$usage"}" + +file="$REPO/@ID@/$tag" +mkdir -p "`dirname "$file"`" +echo "$ID" > "$file" + |