diff options
author | Luke Shumaker <luke@HP-dv6426us-u904.(none)> | 2009-10-28 21:16:58 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:18 -0600 |
commit | bff2fcdc214d1aafc10afa8572aa66757a2f95dc (patch) | |
tree | 8379e0acf4294f31fb37d29dda4792af5a52690e /plugins/filedata | |
parent | c37747c45f22a53bbcd73ae411004d62e66aa0b0 (diff) |
get hacking on rvs
Diffstat (limited to 'plugins/filedata')
-rw-r--r-- | plugins/filedata/commit.sh | 32 | ||||
-rw-r--r-- | plugins/filedata/get.sh | 21 | ||||
-rw-r--r-- | plugins/filedata/main.mk.in | 78 | ||||
-rw-r--r-- | plugins/filedata/plugin.conf.in | 4 |
4 files changed, 135 insertions, 0 deletions
diff --git a/plugins/filedata/commit.sh b/plugins/filedata/commit.sh new file mode 100644 index 0000000..0f3b8d1 --- /dev/null +++ b/plugins/filedata/commit.sh @@ -0,0 +1,32 @@ +#!/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 <http://www.gnu.org/licenses>. + +hash="`cat /dev/stdin`" +file="$1" + +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/plugins/filedata/get.sh b/plugins/filedata/get.sh new file mode 100644 index 0000000..52dbe26 --- /dev/null +++ b/plugins/filedata/get.sh @@ -0,0 +1,21 @@ +#!/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 <http://www.gnu.org/licenses>. + +echo "yeah, this hasn't been coded yet, sorry!" + diff --git a/plugins/filedata/main.mk.in b/plugins/filedata/main.mk.in new file mode 100644 index 0000000..1a04b33 --- /dev/null +++ b/plugins/filedata/main.mk.in @@ -0,0 +1,78 @@ +#!/usr/bin/make -f +name=filedata +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 <http://www.gnu.org/licenses>. + +rvs = @name@ +id = $(name)-$(ver) + +# phony targets #################################################### +all : $(name) +.PHONY : $(name) install uninstall clean distclean dist +.SUFFIXES : + +# build ############################################################ +mysrcdir = $(srcdir)/plugins/$(name) +myoutdir = out + +srcFiles = $(filter-out %/Makefile.in,$(shell find $(mysrcdir)/ -type f)) + +shSrcFiles = $(filter %.sh,$(srcFiles)) +shOutFiles = $(patsubst $(mysrcdir)/%,$(myoutdir)/%,$(basename $(shSrcFiles))) + +$(name) : $(myoutdir) $(shOutFiles) $(myoutdir)/plugin.conf + +$(myoutdir)/plugin.conf : $(mysrcdir)/plugin.conf + $(INSTALL_DATA) $< $@ + +# (un)install ###################################################### + +install : all + $(RVS) install $(name)-$(ver) $(myoutdir) + +uninstall : + $(RVS) uninstall $(name) + +# clean ############################################################ + +clean : + +distclean : clean + $(RM) Makefile + $(RM) -r out + +# implicit rules ################################################### + +b := @ +# build shell scripts +$(myoutdir)/% : $(mysrcdir)/%.sh $(myoutdir) + $(INSTALL_PROGRAM) $< $@ + $(SED) -i \ + -e 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' \ + -e 's/$blibexecdir@/$(subst /,\/,$(libexecdir))/g' \ + -e 's/$bID@/$(subst /,\/,$(id))/g' \ + $@ + +plugin.conf : plugin.conf.in + $(SED) \ + -e 's/$bname@/$(subst /,\/,$(name))/g' \ + -e 's/$bver@/$(subst /,\/,$(ver))/g' \ + $< > $@ + +$(DESTDIR)$(libexecdir)/$(rvs) $(myoutdir) : + $(MKDIR) $@ + diff --git a/plugins/filedata/plugin.conf.in b/plugins/filedata/plugin.conf.in new file mode 100644 index 0000000..d7c834c --- /dev/null +++ b/plugins/filedata/plugin.conf.in @@ -0,0 +1,4 @@ +# rvs @name@ plugins.conf +# ver=@ver@ +commit:repo-0.9/commit +get |