From 3ba891676dfb500d7846d1f203f1e48f6f049236 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 21 Mar 2016 13:40:17 +0000 Subject: [PATCH] projects-dir.mk: Add support for JANWARE_USER Signed-off-by: Jan Lindemann --- make/projects-dir.mk | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/make/projects-dir.mk b/make/projects-dir.mk index b8b1f1a1..23480390 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -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 $@