diff --git a/make/projects-dir.mk b/make/projects-dir.mk index a8b6eb9b..ee866cbf 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -1,14 +1,22 @@ +ifneq ($(PROJECTS),) +export PGIT_CLONE_PROJECTS = $(PROJECTS) +endif + +ifneq ($(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) else -PROJECTS = $(dir $(wildcard */CVS */.git)) -CVS_PROJECTS = $(dir $(wildcard */CVS)) +PROJECTS ?= $(dir $(wildcard */CVS */.git)) +CVS_PROJECTS = $(filter $(dir $(wildcard */CVS)),$(PROJECTS)) endif WHOAMI = $(shell id -un) -RGIT = /bin/bash $(firstword $(wildcard ./ytools/devutil/scripts/pgit.sh /opt/ytools/bin/pgit.sh)) +PGIT = CLONE_PROJECTS="$(PROJECTS)" CLONE_FROM_USER="$(shell whoami)" /bin/bash $(firstword $(wildcard ./ytools/devutil/scripts/pgit.sh /opt/ytools/bin/pgit.sh)) all: for p in $(PROJECTS); do make -C $$p || break; done @@ -24,22 +32,22 @@ cpp: done clone diff commit push: - $(RGIT) $@ + $(PGIT) $@ git-push: - $(RGIT) push + $(PGIT) push update pull: cvs update -dP $(CVS_PROJECTS) - $(RGIT) pull + $(PGIT) pull git-pull: - $(RGIT) pull + $(PGIT) pull status: for p in $(CVS_PROJECTS); do test -f $$d/CVS || echo $$p; done cvs status $(addsuffix VERSION,$(CVS_PROJECTS)) - $(RGIT) status + $(PGIT) status git-conv-%: mv $* old/