projects-dir.mk: Be offline without JANWAR_USER

Keep Makefile from communicating with servers if JANWARE_USER is not
set.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-12-17 16:30:44 +00:00
commit 13255763fe

View file

@ -49,6 +49,9 @@ BUILD_PROJECTS = $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS))
ifeq ($(JANWARE_USER),)
export JANWARE_USER = $(shell id -un)
UNAVAILABLE_TARGETS ?= pull.done update.done clone.done
else
UNAVAILABLE_TARGETS ?=
endif
CWD := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
@ -94,7 +97,7 @@ CVS_ADMIN_SH = JW_BUILD_SSH_EXTRA_OPTS="$(JW_BUILD_SSH_EXTRA_OPTS)" $(G
# ------------ targets
all: pull.done
all: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
$(BUILD_PY) $@ $(BUILD_PROJECTS)
clean: clean-dirs done.clean
distclean: clean-all-dirs done.clean
@ -105,11 +108,11 @@ install:
@echo
@exit 1
build-order: pull.done
build-order: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
$(BUILD_PY) order $(BUILD_PROJECTS) | sed 's/ */\n/g'
clean-dirs:
ls */dirs-started-all.done 2>/dev/null | sed 's%/.*%%' | xargs -r $(BUILD_PY) clean
if [ -n "$(wildcard */*.done)" ]; then ls */*.done 2>/dev/null | sed 's%/.*%%' | xargs -r $(BUILD_PY) clean; fi
clean-all-dirs:
$(BUILD_PY) clean $(PROJECTS)
@ -148,7 +151,7 @@ pkg-fetch-from-%:
pkg-release-all:
/bin/bash ./packager-client/scripts/packager-client-2.sh
pkg-%: pull.done
pkg-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
$(BUILD_PY) $@ $(BUILD_PROJECTS)
pkg-init-%:
@ -288,16 +291,16 @@ cvsdir.done: ssh-wrapper.sh
fi
touch $@
cvs-update.done: cvsdir.done ssh-wrapper.sh
cvs-update.done: $(filter-out $(UNAVAILABLE_TARGETS),cvsdir.done ssh-wrapper.sh)
cvs update -dP Makefile $(shell $(CVS_ADMIN_SH) list-projects)
touch $@
update.done: purge
pull.done: cvs-update.done clone.done links.done
pull.done: $(filter-out $(UNAVAILABLE_TARGETS),cvs-update.done clone.done links.done)
touch $@
clone.done: ssh-wrapper.sh
clone.done: $(filter-out $(UNAVAILABLE_TARGETS),ssh-wrapper.sh)
$(PGIT) clone
touch $@