diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/repo/Makefile.in | 10 | ||||
-rw-r--r-- | plugins/repo/commit.f.sh | 2 | ||||
-rw-r--r-- | plugins/repo/get.d.sh | 8 | ||||
-rw-r--r-- | plugins/users/Makefile.in | 58 |
4 files changed, 41 insertions, 37 deletions
diff --git a/plugins/repo/Makefile.in b/plugins/repo/Makefile.in index 8105b75..12fb469 100644 --- a/plugins/repo/Makefile.in +++ b/plugins/repo/Makefile.in @@ -1,6 +1,6 @@ #!/usr/bin/make -f name = repo -# version 0.7.0 +# version 0.7.1 # 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 @@ -39,13 +39,13 @@ all : $(name) .SUFFIXES : # main ############################################################# +mysrcdir = $(srcdir)/plugins/$(name) +myoutdir = out + srcFiles = $(filter-out %/Makefile.in,$(shell find $(mysrcdir)/ -type f)) shSrcFiles = $(filter %.sh,$(srcFiles)) -shOutFiles = $(patsubst $(mysrcdir)/%,out/%,$(basename $(shSrcFiles))) - -mysrcdir = $(srcdir)/plugins/$(name) -myoutdor = out +shOutFiles = $(patsubst $(mysrcdir)/%,$(myoutdir)/%,$(basename $(shSrcFiles))) $(name) : $(shOutFiles) diff --git a/plugins/repo/commit.f.sh b/plugins/repo/commit.f.sh index bb4a7d8..ebc8214 100644 --- a/plugins/repo/commit.f.sh +++ b/plugins/repo/commit.f.sh @@ -14,7 +14,7 @@ ver='0.7.0' # commit.f FILENAME file="$1" -#hash=`md5sum $file | sed "s/ .*$//"` +#hash=`md5sum $file | sed "s/ .*$//"` hash=`sha1sum $file | sed "s/ .*$//"` if [ ! -f "$REPO/$hash" ]; then install -m 644 -o $USER -g $USER -T "$file" "$REPO/$hash" diff --git a/plugins/repo/get.d.sh b/plugins/repo/get.d.sh index 98c490c..9ef25b9 100644 --- a/plugins/repo/get.d.sh +++ b/plugins/repo/get.d.sh @@ -20,8 +20,12 @@ tmp=`tempfile` mkdir "$dir" while read line; do - hash=`echo "$line" | sed 's/^.*://'` - name=`echo "$line" | sed "s/:$hash$//"` + # GNU bash optimized version + #hash=${line/#*:/} + #name=${line/%:${hash}/} + # POSIX version + hash=`echo "$line" | sed 's/^.*://'` + name=`echo "$line" | sed "s/:$hash$//"` "$RVSDIR/get" "$dir/$file" done < "$tmp" diff --git a/plugins/users/Makefile.in b/plugins/users/Makefile.in index 5c97ef2..975d884 100644 --- a/plugins/users/Makefile.in +++ b/plugins/users/Makefile.in @@ -1,6 +1,6 @@ #!/usr/bin/make -f name = users -# version 0.7.0 +# version 0.7.1 # 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 @@ -10,70 +10,70 @@ name = users # Originally written by Luke Shumaker <lukeshu@sbcglobal.net>. -# Variables ######################################################## -RM ?= rm -f +export rvs ?= @name@ +# Directories ###################################################### +srcdir ?= @srcdir@ +prefix ?= @prefix@ +exec_prefix ?= @exec_prefix@ +bindir ?= @bindir@ +sbindir ?= @sbindir@ +libexecdir ?= @libexecdir@ +#export srcdir prefix exec_prefix bindir sbindir libexecdir + +# Programs ######################################################### +RVS ?= @RVS@ +SHELL ?= @SHELL@ +RM ?= rm CP ?= cp SED ?= sed -INSTALL = install +INSTALL ?= install MKDIR ?= $(INSTALL) -d #mkdir -p INSTALL_PROGRAM ?= $(INSTALL) INSTALL_DATA ?= $(INSTALL) -m 644 - -SHELL ?= @SHELL@ -rvsdir ?= @rvsdir@/rvs -srcdir ?= @srcdir@ - -libdir = $(rvsdir)/$(name) -reldir = plugins/$(name) - -mysrcdir = $(srcdir)/$(reldir) -VPATH = $(mysrcdir) +TOUCH ?= touch # This file doesn't use touch +#export RVS SHELL RM CP SED INSTALL MKDIR INSTALL_PROGRAM INSTALL_DATA TOUCH # phony targets #################################################### all : $(name) .PHONY : $(name) install uninstall clean distclean .SUFFIXES : -# targets ########################################################## +# main ############################################################# +mysrcdir = $(srcdir)/plugins/$(name) +myoutdir = out + srcFiles = $(filter-out %/Makefile.in,$(shell find $(mysrcdir)/ -type f)) shSrcFiles = $(filter %.sh,$(srcFiles)) -shOutFiles = $(patsubst $(mysrcdir)/%,%,$(basename $(shSrcFiles))) -shExeFiles = $(patsubst %,$(libdir)/%, $(shOutFiles) ) +shOutFiles = $(patsubst $(mysrcdir)/%,$(myoutdir)/%,$(basename $(shSrcFiles))) $(name) : $(shOutFiles) # (un)install ###################################################### -install : $(shExeFiles) - echo $(name) >> $(rvsdir)/plugins +install : all + $(RVS) install $(name) $(myoutdir) uninstall : - $(RM) -r $(libdir) - $(SED) -i "/^$(name)$/ d" $(rvsdir)/plugins + $(RVS) uninstall $(name) # clean ############################################################ clean : - $(RM) $(shOutFiles) distclean : clean $(RM) Makefile + $(RM) -r out # implicit rules ################################################### b := @ # build shell scripts -% : $(mysrcdir)/%.sh +$(myoutdir)/% : $(mysrcdir)/%.sh $(MKDIR) $(dir $@) $(SED) 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' <$< > $@ # workaround... idk why it doesn't match `lib/' -lib/% : $(mysrcdir)/lib/%.sh +$(myoutdir)/lib/% : $(mysrcdir)/lib/%.sh $(MKDIR) $(dir $@) $(SED) 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' <$< > $@ -# install -$(libdir)/% : % - $(MKDIR) $(dir $@) - $(INSTALL_PROGRAM) $< $@ - |