summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-03-04 01:07:34 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-03-04 01:07:34 -0500
commit978a32cec48ee55ed3717d2de4d78184755edbdf (patch)
treee26a3fc3215ea76eb997cd9fe23a844b77f24584
parent4f5ce5854f478cfa38024b74d9c2849b794e979e (diff)
fix mistakes
-rw-r--r--config.mk.in47
-rwxr-xr-xconfigure14
-rw-r--r--modules/comments/Module.mk2
-rw-r--r--modules/date.author/Module.mk2
-rw-r--r--modules/tags/Module.mk2
-rw-r--r--modules/tree/Module.mk2
-rw-r--r--wrapper/inner.sh.m42
7 files changed, 62 insertions, 9 deletions
diff --git a/config.mk.in b/config.mk.in
new file mode 100644
index 0000000..ca8fa7f
--- /dev/null
+++ b/config.mk.in
@@ -0,0 +1,47 @@
+ifeq ($(topsrcdir),)
+topsrcdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+
+PACKAGE = rvs
+VERSION = 0.10
+pkgtextdomain = $(PACKAGE)
+
+DESTDIR =
+prefix = /usr/local
+exec_prefix = $(prefix)
+
+bindir = $(exec_prefix)/bin
+sbindir = $(exec_prefix)/sbin
+libexecdir = $(exec_prefix)/libexec
+datarootdir = $(prefix)/share
+datadir = $(datarootdir)
+sysconfdir = $(prefix)/etc
+sharedstatedir = $(prefix)/com
+localstatedir = $(prefix)/var
+runstatedir = $(localstatedir)/run
+localedir = $(datarootdir)/locale
+
+pkgdatadir = $(datadir)/$(PACKAGE)
+pkglibexecdir = $(libexecdir)/$(PACKAGE)
+
+CFLAGS = -std=c99 -Werror -Wall -Wextra -pedantic -O2
+CPPFLAGS = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
+
+CC = cc
+M4 = m4
+MKDIR = mkdir
+MKDIRS = mkdir -p
+RMDIRS = rmdir -p
+INSTALL_DATA = install -m644
+INSTALL_PROGRAM = install -m755
+CP = cp
+MV = mv
+RM = rm -f
+SED = sed
+SORT = sort
+TAR = tar
+TRUE = true
+PRINTF = printf
+
+AUTODEPS = t
+
+endif
diff --git a/configure b/configure
index 9683b68..ef9a41f 100755
--- a/configure
+++ b/configure
@@ -25,11 +25,17 @@ error() {
exit 1
}
-edit=(sed -E -e '')
+topsrcdir=$(realpath -ms --relative-to=. -- "$srcdir")
+if [ "$topsrcdir" = . ]; then
+ topsrcdir=
+else
+ topsrcdir=/$topsrcdir
+fi
+
+edit=(sed -E -e "s|^topsrcdir := .*|&$topsrcdir|")
setvar() {
edit+=(-e "s@^(\s*$1\s*:?=).*@\1 $2@")
}
-setvar topsrcdir "$srcdir"
vars=($(<"$srcdir/config.mk.in" sed -n 's/^\([ a-z_-]*\)=.*/\1/p'))
@@ -53,11 +59,11 @@ done
"${edit[@]}" < "$srcdir/config.mk.in" > "$outdir/config.mk"
-Makefiles=($(find "$srcdir/" -name 'Makefile') "$srcdir"/*.mk "$srcdir"/modules/module.mk "$srcdir"/modules/*/Makefile.inc.mk)
+Makefiles=($(find "$srcdir/" -name 'Makefile') "$srcdir"/modules/module.mk "$srcdir"/modules/*/Makefile.inc.mk)
for src in "${Makefiles[@]}"; do
out="$outdir/${src#$srcdir/}"
mkdir -p -- $(dirname -- "$out")
if ! test "$src" -ef "$out"; then
- cp -fTv -- "$src" "$out"
+ cp -fT -- "$src" "$out"
fi
done
diff --git a/modules/comments/Module.mk b/modules/comments/Module.mk
index 3fa49ac..aa0a9af 100644
--- a/modules/comments/Module.mk
+++ b/modules/comments/Module.mk
@@ -1 +1 @@
-commit/comments : commit/blobs
+comments/commit : blobs/commit
diff --git a/modules/date.author/Module.mk b/modules/date.author/Module.mk
index 30cd2e0..2b94226 100644
--- a/modules/date.author/Module.mk
+++ b/modules/date.author/Module.mk
@@ -1 +1 @@
-commit/date.author : commit/blobs
+date.author/commit : blobs/commit
diff --git a/modules/tags/Module.mk b/modules/tags/Module.mk
index 2ef7ffb..30224d0 100644
--- a/modules/tags/Module.mk
+++ b/modules/tags/Module.mk
@@ -1 +1 @@
-commit/tags : commit/blobs commit/tree
+tags/commit : blobs/commit tree/commit
diff --git a/modules/tree/Module.mk b/modules/tree/Module.mk
index c214a35..b57eb5a 100644
--- a/modules/tree/Module.mk
+++ b/modules/tree/Module.mk
@@ -1 +1 @@
-commit/tree : commit/blobs
+tree/commit : blobs/commit
diff --git a/wrapper/inner.sh.m4 b/wrapper/inner.sh.m4
index bd7a643..b07199e 100644
--- a/wrapper/inner.sh.m4
+++ b/wrapper/inner.sh.m4
@@ -130,7 +130,7 @@ _init() {
cd "$dir"
repo="$(_repo 2> /dev/null)" || true
if [ -n "${repo:-}" ]; then
- _error 129 "Repository already exists at \`%s'" "$repo"
+ error 129 "Repository already exists at \`%s'" "$repo"
fi
export "$varname_REPO=$PWD/.${PACKAGE,,}"
mkdir "${!varname_REPO}"