projects-dir.mk: Support CLONE_FROM_USER, PROJECTS

Add support for environment variables CLONE_FROM_USER and PROJECTS.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2015-06-12 15:22:25 +00:00
commit e49351a515

View file

@ -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/