summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <luke@HP-dv6426us-u904.(none)>2009-11-02 20:33:40 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:18 -0600
commit419801528066ea61546cde30c9f9f7f953e823b5 (patch)
tree55f9196d32710272fb07080ecf0863ce9e63ba76
parent2db6b833176b0a0a55de21a38a83bd97df537191 (diff)
It appears I'd previously edited other files, but as far as I knew a moment ago:
The Makefiles have had support for DESTDIR for some time. I just realised configure didn't Which lead me to find some bugs in configure's option handling.
-rw-r--r--Makefile2
-rw-r--r--Makefile.in2
-rwxr-xr-xconfigure15
-rw-r--r--rvs/plugins/filedata/commit.sh3
-rw-r--r--rvs/plugins/filedata/get.sh2
-rw-r--r--rvs/plugins/files/commit.d.sh5
-rw-r--r--rvs/plugins/files/commit.f.sh5
7 files changed, 22 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 5840c65..9662463 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ complete-% : %/
%-build : %/; $(MKDIR) $@
%-build/Makefile : %-build complete-%
- cd $<; ../$(patsubst %-build,%/,$<)/configure
+ cd $<; ../$(patsubst %-build,%/,$<)/configure $(CONFIG)
$(MAKE) -C $< Makefiles
build-% : %-build %-build/Makefile; $(MAKE) -C $<
diff --git a/Makefile.in b/Makefile.in
index b6ce55e..42e7790 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -69,7 +69,7 @@ Makefiles : $(shell find '$(srcdir)' -type f -name Makefile.in) \
$(csources:.c=.d)
%Makefile %.mk : $(srcdir)/configure
- $<
+ $< @CONFIG@
# This is taken straight from the GNU `make' manual.
# That makes it GFDL, which is incompatible with the GPL
diff --git a/configure b/configure
index 4856815..b5209e9 100755
--- a/configure
+++ b/configure
@@ -17,13 +17,15 @@ name='configure' # Luke's configureation script
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
+ _DESTDIR=''
_prefix='/usr/local'
_exec_prefix='$(prefix)'
_bindir='$(exec_prefix)/bin'
_sbindir='$(exec_prefix)/sbin'
_libexecdir='$(exec_prefix)/libexec'
_srcdir=$(readlink -f `dirname "$0"`)
-vars='prefix exec_prefix bindir sbindir libexecdir srcdir'
+ _CONFIG="$@"
+vars='DESTDIR prefix exec_prefix bindir sbindir libexecdir srcdir CONFIG'
if [ -f "$_srcdir/config" ]; then . "$_srcdir/config"; fi
error() {
@@ -31,9 +33,11 @@ error() {
exit 1
}
-args=`getopt -n "$name" -o "${sopt}" -l "${lopt}${vars}" -- "$@"`
+varargs=`echo "$vars " | sed -e 's/ */:,/g' -e 's/,$//'`
+args=`getopt -n "$name" -o "${sopt}" -l "${lopt}${varargs}" -- "$@"`
if [ $? == 0 ]; then
set -- $args
+ echo "$@"
while [ $# -gt 0 ]; do case "$1" in
--) break;;
--*)
@@ -46,13 +50,14 @@ if [ $? == 0 ]; then
fi
done
if [ "$match" == 'true' ]; then
- val="$2"
+ shift
+ val="$1"
eval _$var0=$val
else
- error "option \`$1' not recognized";
+ error "unrecognized option \`$1'";
fi
:;;
- *) error "option \`$1' not recognized";;
+ *) error "unrecognized option \`$1'";
esac
shift
done
diff --git a/rvs/plugins/filedata/commit.sh b/rvs/plugins/filedata/commit.sh
index 0f3b8d1..f046db4 100644
--- a/rvs/plugins/filedata/commit.sh
+++ b/rvs/plugins/filedata/commit.sh
@@ -17,8 +17,9 @@ ver=0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
+out="$1"
+file="$2"
hash="`cat /dev/stdin`"
-file="$1"
temp=`mktemp`
echo "Hash: $hash" > "$temp"
diff --git a/rvs/plugins/filedata/get.sh b/rvs/plugins/filedata/get.sh
index 52dbe26..321d5f8 100644
--- a/rvs/plugins/filedata/get.sh
+++ b/rvs/plugins/filedata/get.sh
@@ -17,5 +17,7 @@ ver=0.9
# 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/rvs/plugins/files/commit.d.sh b/rvs/plugins/files/commit.d.sh
index 2b3f022..f5b432b 100644
--- a/rvs/plugins/files/commit.d.sh
+++ b/rvs/plugins/files/commit.d.sh
@@ -20,7 +20,8 @@ ver=0.9
source "$libexecdir/@ID@/stdio"
# commit.d DIRNAME
-dir="$1"
+out="$1"
+dir="$2"
tmp=`mktemp`
cd "$dir"
@@ -29,6 +30,6 @@ for file in *; do
echo "$file:$hash" >> "$tmp"
done
-"$RVS" commit.f "$tmp"
+"$RVS" commit.f "$out" "$tmp"
rm "$tmp"
diff --git a/rvs/plugins/files/commit.f.sh b/rvs/plugins/files/commit.f.sh
index bbcbbe4..a86e5b5 100644
--- a/rvs/plugins/files/commit.f.sh
+++ b/rvs/plugins/files/commit.f.sh
@@ -20,12 +20,13 @@ ver=0.9
#source "$libexecdir/@ID@/stdio"
# commit.f FILENAME
-file="$1"
+out="$1"
+file="$2"
#hash=`md5sum $file | sed "s/ .*$//"`
hash=`sha1sum $file | sed "s/ .*$//"`
if [ ! -f "$REPO/@ID@/$hash" ]; then
install -m 644 -o $USER -g $USER -T "$file" "$REPO/@ID@/$hash"
fi
-echo "$hash"
+echo "$hash" >> "$out"