projects-dir.mk: Add safety target cvs-check-user

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2018-03-08 09:26:57 +00:00
commit dc23912d5b

View file

@ -68,10 +68,9 @@ ifeq ($(JANWARE_USER),)
UNAVAILABLE_TARGETS ?= pull.done update.done clone.done
else
UNAVAILABLE_TARGETS ?=
export CVSROOT = :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs
endif
export CVSROOT = :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs
ifneq ($(JW_BUILD_SSH),)
export CVS_RSH := $(JW_BUILD_SSH)
else
@ -300,16 +299,22 @@ clean.ssh-wrapper:
rm -f $(SSH_WRAPPER_SH)
clean: clean.ssh-wrapper
cvs-check-user:
@if ! grep -q ":ext:$(JANWARE_USER)@" CVS/Root; then \
echo "Wrong username in CVS/Root, change that to: $(CVSROOT)" ;\
exit 1; \
fi
cvsdir.done: $(SSH_WRAPPER_SH)
if [ ! -d CVS ]; then \
mkdir CVS && \
echo :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs > CVS/Root && \
echo $(CVSROOT) > CVS/Root && \
echo proj > CVS/Repository && \
echo "/Makefile/$Revision$ ///" | sed 's/ *evision: *\([0-9.]*\) */\1/; s/ *$$ *//' > CVS/Entries ;\
fi
touch $@
cvs-update.done: $(filter-out $(UNAVAILABLE_TARGETS),cvsdir.done $(SSH_WRAPPER_SH))
cvs-update.done: cvsdir.done $(SSH_WRAPPER_SH) cvs-check-user
cvs update -dP Makefile $(shell $(CVS_ADMIN_SH) list-projects)
touch $@