projects-dir.mk: Add support for JANWARE_USER

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-03-21 13:40:17 +00:00
commit 3ba891676d

View file

@ -17,23 +17,36 @@ define newline
endef
ifneq ($(PROJECTS),)
export PGIT_CLONE_PROJECTS = $(PROJECTS)
export PGIT_CLONE_PROJECTS = $(PROJECTS)
endif
ifneq ($(CLONE_FROM_USER),)
export PGIT_CLONE_FROM_USER = $(CLONE_FROM_USER)
export PGIT_CLONE_FROM_USER = $(CLONE_FROM_USER)
endif
ifneq ($(wildcard projects.txt),)
PROJECTS = $(shell cat projects.txt | sed '/^ *\#/ d')
# TODO: this could be nicer
CVS_PROJECTS = $(PROJECTS)
PROJECTS = $(shell cat projects.txt | sed '/^ *\#/ d')
# TODO: this could be nicer
CVS_PROJECTS = $(PROJECTS)
else
PROJECTS ?= $(shell ls -d */CVS */.git 2>/dev/null | sed 's%/[^/]*%%')
CVS_PROJECTS = $(filter $(dir $(wildcard */CVS)),$(PROJECTS))
PROJECTS ?= $(shell ls -d */CVS */.git 2>/dev/null | sed 's%/[^/]*%%')
CVS_PROJECTS = $(filter $(dir $(wildcard */CVS)),$(PROJECTS))
endif
WHOAMI = $(shell id -un)
ifeq ($(JANWARE_USER),)
WHOAMI = $(shell id -un)
else
WHOAMI = $(JANWARE_USER)
endif
ifeq ($(CVSROOT),)
CVSROOT = :ext:$(WHOAMI)@cvs.jannet.de:/home/jannet/arc/cvs
export CVSROOT
endif
CVS_RSH = ssh
export CVS_RSH
PGIT = CLONE_PROJECTS="$(PROJECTS)" CLONE_FROM_USER="$(shell whoami)" /bin/bash $(firstword $(wildcard ./ytools/devutil/scripts/pgit.sh /opt/ytools/bin/pgit.sh))
EXCLUDE_FROM_BUILD = \
@ -121,6 +134,8 @@ cvsdir.done:
if [ ! -d CVS ]; then \
echo -e '$(subst $(newline),\n,${CVSDIR_MIME})' | tee /tmp/test.mime | mimencode -u | tar -xjf - ;\
fi
sed -i "s/.*@cvs.jannet.de/$(shell id -un)@cvs.jannet.de/" CVS/Root
if grep -q "^jan@cvs.jannet.de/" CVS/Root; then \
echo $(CVSROOT) > CVS/Root ;\
fi
touch $@