diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/filedata/bin/commit | 33 | ||||
-rw-r--r-- | plugins/filedata/bin/commit.sh (renamed from plugins/filedata/commit.sh) | 2 | ||||
-rw-r--r-- | plugins/filedata/bin/get (renamed from plugins/filedata/get.sh) | 0 | ||||
-rw-r--r-- | plugins/filedata/bin/get.sh | 23 | ||||
-rw-r--r-- | plugins/filedata/info.mk.in | 1 | ||||
-rw-r--r-- | plugins/filedata/plugin.conf.in | 4 | ||||
-rw-r--r-- | plugins/files/bin/commit | 36 | ||||
-rw-r--r-- | plugins/files/bin/commit.d.sh (renamed from plugins/files/commit.d.sh) | 0 | ||||
-rw-r--r-- | plugins/files/bin/commit.f.sh (renamed from plugins/files/commit.f.sh) | 0 | ||||
-rw-r--r-- | plugins/files/bin/commit.sh | 36 | ||||
-rw-r--r-- | plugins/files/bin/get.d.sh (renamed from plugins/files/get.d.sh) | 0 | ||||
-rw-r--r-- | plugins/files/bin/get.f.sh (renamed from plugins/files/get.f.sh) | 0 | ||||
-rw-r--r-- | plugins/files/bin/get.sh (renamed from plugins/files/get.sh) | 0 | ||||
-rw-r--r-- | plugins/files/commit.sh | 41 | ||||
-rw-r--r-- | plugins/files/etc/3-d.sh | 20 | ||||
-rw-r--r-- | plugins/files/etc/5-f.sh | 20 | ||||
-rw-r--r-- | plugins/files/info.mk.in | 1 | ||||
-rw-r--r-- | plugins/files/lib/stdio.sh (renamed from plugins/files/stdio.sh) | 0 | ||||
-rw-r--r-- | plugins/files/plugin.conf.in | 8 | ||||
-rw-r--r-- | plugins/main.mk.in | 31 | ||||
-rw-r--r-- | plugins/plugin.mk.in | 53 | ||||
-rw-r--r-- | plugins/users/bin/commit.sh (renamed from plugins/users/commit.sh) | 0 | ||||
-rw-r--r-- | plugins/users/bin/init.sh (renamed from plugins/users/init.sh) | 0 | ||||
-rw-r--r-- | plugins/users/bin/login.sh (renamed from plugins/users/login.sh) | 0 | ||||
-rw-r--r-- | plugins/users/bin/logout.sh (renamed from plugins/users/logout.sh) | 0 | ||||
-rw-r--r-- | plugins/users/bin/mkuser.sh (renamed from plugins/users/mkuser.sh) | 0 | ||||
-rw-r--r-- | plugins/users/bin/rmuser.sh (renamed from plugins/users/rmuser.sh) | 0 | ||||
-rw-r--r-- | plugins/users/lib/stdio.sh (renamed from plugins/users/stdio.sh) | 0 | ||||
-rw-r--r-- | plugins/users/plugin.conf.in | 7 |
29 files changed, 226 insertions, 90 deletions
diff --git a/plugins/filedata/bin/commit b/plugins/filedata/bin/commit new file mode 100644 index 0000000..9b7f59a --- /dev/null +++ b/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 <http://www.gnu.org/licenses>. + +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/plugins/filedata/commit.sh b/plugins/filedata/bin/commit.sh index f046db4..9b7f59a 100644 --- a/plugins/filedata/commit.sh +++ b/plugins/filedata/bin/commit.sh @@ -25,7 +25,7 @@ temp=`mktemp` echo "Hash: $hash" > "$temp" stat "$file" >> "$temp" -meta=`sha1sum $temp | sed "s/ .*$//"` +meta=`sha1sum "$temp" | sed "s/ .*$//"` if [ ! -f "$REPO/@ID@/$hash" ]; then install -m 644 -o $USER -g $USER -T "$temp" "$REPO/@ID@/$meta" fi diff --git a/plugins/filedata/get.sh b/plugins/filedata/bin/get index 321d5f8..321d5f8 100644 --- a/plugins/filedata/get.sh +++ b/plugins/filedata/bin/get diff --git a/plugins/filedata/bin/get.sh b/plugins/filedata/bin/get.sh new file mode 100644 index 0000000..321d5f8 --- /dev/null +++ b/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 <http://www.gnu.org/licenses>. + +out="$1" + +echo "yeah, this hasn't been coded yet, sorry!" + diff --git a/plugins/filedata/info.mk.in b/plugins/filedata/info.mk.in index 77643cd..0746843 100644 --- a/plugins/filedata/info.mk.in +++ b/plugins/filedata/info.mk.in @@ -1,2 +1,3 @@ name = filedata ver = 0.9 +priority = 1 diff --git a/plugins/filedata/plugin.conf.in b/plugins/filedata/plugin.conf.in deleted file mode 100644 index d7c834c..0000000 --- a/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/plugins/files/bin/commit b/plugins/files/bin/commit new file mode 100644 index 0000000..63eaac1 --- /dev/null +++ b/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 <http://www.gnu.org/licenses>. + +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/plugins/files/commit.d.sh b/plugins/files/bin/commit.d.sh index f5b432b..f5b432b 100644 --- a/plugins/files/commit.d.sh +++ b/plugins/files/bin/commit.d.sh diff --git a/plugins/files/commit.f.sh b/plugins/files/bin/commit.f.sh index a86e5b5..a86e5b5 100644 --- a/plugins/files/commit.f.sh +++ b/plugins/files/bin/commit.f.sh diff --git a/plugins/files/bin/commit.sh b/plugins/files/bin/commit.sh new file mode 100644 index 0000000..63eaac1 --- /dev/null +++ b/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 <http://www.gnu.org/licenses>. + +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/plugins/files/get.d.sh b/plugins/files/bin/get.d.sh index 46e1eeb..46e1eeb 100644 --- a/plugins/files/get.d.sh +++ b/plugins/files/bin/get.d.sh diff --git a/plugins/files/get.f.sh b/plugins/files/bin/get.f.sh index e6b79d5..e6b79d5 100644 --- a/plugins/files/get.f.sh +++ b/plugins/files/bin/get.f.sh diff --git a/plugins/files/get.sh b/plugins/files/bin/get.sh index 4d0d48f..4d0d48f 100644 --- a/plugins/files/get.sh +++ b/plugins/files/bin/get.sh diff --git a/plugins/files/commit.sh b/plugins/files/commit.sh deleted file mode 100644 index 32d3042..0000000 --- a/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 <http://www.gnu.org/licenses>. - -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/plugins/files/etc/3-d.sh b/plugins/files/etc/3-d.sh new file mode 100644 index 0000000..91163dc --- /dev/null +++ b/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 <http://www.gnu.org/licenses>. + +if [ -f $file ]; then echo 'd'; fi diff --git a/plugins/files/etc/5-f.sh b/plugins/files/etc/5-f.sh new file mode 100644 index 0000000..975992a --- /dev/null +++ b/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 <http://www.gnu.org/licenses>. + +if [ -f $file ]; then echo 'f'; fi diff --git a/plugins/files/info.mk.in b/plugins/files/info.mk.in index d7ccb97..7552306 100644 --- a/plugins/files/info.mk.in +++ b/plugins/files/info.mk.in @@ -1,2 +1,3 @@ name = files ver = 0.9 +priority = 0 diff --git a/plugins/files/stdio.sh b/plugins/files/lib/stdio.sh index 9062683..9062683 100644 --- a/plugins/files/stdio.sh +++ b/plugins/files/lib/stdio.sh diff --git a/plugins/files/plugin.conf.in b/plugins/files/plugin.conf.in deleted file mode 100644 index 2359dd5..0000000 --- a/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/plugins/main.mk.in b/plugins/main.mk.in index f0401d1..3039c1f 100644 --- a/plugins/main.mk.in +++ b/plugins/main.mk.in @@ -17,22 +17,37 @@ # along with this program; see the file COPYING. # If not, see <http://www.gnu.org/licenses>. +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/plugins/plugin.mk.in b/plugins/plugin.mk.in index 6980538..8af5fcc 100644 --- a/plugins/plugin.mk.in +++ b/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 <http://www.gnu.org/licenses>. +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/plugins/users/commit.sh b/plugins/users/bin/commit.sh index 1fa2e52..1fa2e52 100644 --- a/plugins/users/commit.sh +++ b/plugins/users/bin/commit.sh diff --git a/plugins/users/init.sh b/plugins/users/bin/init.sh index 142f54c..142f54c 100644 --- a/plugins/users/init.sh +++ b/plugins/users/bin/init.sh diff --git a/plugins/users/login.sh b/plugins/users/bin/login.sh index 40a5830..40a5830 100644 --- a/plugins/users/login.sh +++ b/plugins/users/bin/login.sh diff --git a/plugins/users/logout.sh b/plugins/users/bin/logout.sh index 260846e..260846e 100644 --- a/plugins/users/logout.sh +++ b/plugins/users/bin/logout.sh diff --git a/plugins/users/mkuser.sh b/plugins/users/bin/mkuser.sh index 6f72ea9..6f72ea9 100644 --- a/plugins/users/mkuser.sh +++ b/plugins/users/bin/mkuser.sh diff --git a/plugins/users/rmuser.sh b/plugins/users/bin/rmuser.sh index 604f359..604f359 100644 --- a/plugins/users/rmuser.sh +++ b/plugins/users/bin/rmuser.sh diff --git a/plugins/users/stdio.sh b/plugins/users/lib/stdio.sh index edf7c01..edf7c01 100644 --- a/plugins/users/stdio.sh +++ b/plugins/users/lib/stdio.sh diff --git a/plugins/users/plugin.conf.in b/plugins/users/plugin.conf.in deleted file mode 100644 index 9b1b35c..0000000 --- a/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 |