projects-dir.mk: Conditionally pass --create-remote-user-repos

Pass --create-remote-user-repos to pgit.sh clone in case JANWARE_USER
is defined, restoring the original behaviour.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-11-18 16:39:52 +01:00
commit 370c7e499e

View file

@ -79,6 +79,7 @@ ifeq ($(JANWARE_USER),)
OFFLINE ?= true OFFLINE ?= true
else else
export JANWARE_USER export JANWARE_USER
PGIT_SH_CLONE += --create-remote-user-repos
endif endif
ifeq ($(OFFLINE),true) ifeq ($(OFFLINE),true)
@ -127,6 +128,7 @@ endif
PROJECTS_PY = PYTHONPATH=$(realpath $(JWBDIR)/src/python) $(TIME) python3 $(JWB_SCRIPT_DIR)/jw-projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS) PROJECTS_PY = PYTHONPATH=$(realpath $(JWBDIR)/src/python) $(TIME) python3 $(JWB_SCRIPT_DIR)/jw-projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS)
PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_OPTS) PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_OPTS)
PGIT_SH = /bin/bash $(JWB_SCRIPT_DIR)/pgit.sh PGIT_SH = /bin/bash $(JWB_SCRIPT_DIR)/pgit.sh
PGIT_SH_CLONE = $(PGIT_SH) clone
PURGE_SH = /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/purge-stale-projects.sh $(JW_BUILD_BINDIR)/purge-stale-projects.sh) purge-not-found) PURGE_SH = /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/purge-stale-projects.sh $(JW_BUILD_BINDIR)/purge-stale-projects.sh) purge-not-found)
PKG_MANAGER_SH ?= /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/pkg-manager.sh $(JW_BUILD_BINDIR)/pkg-manager.sh) pkg-manager-not-found) PKG_MANAGER_SH ?= /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/pkg-manager.sh $(JW_BUILD_BINDIR)/pkg-manager.sh) pkg-manager-not-found)
CREATE_PROJECT_SH ?= /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/jw-build-create-project.sh $(JW_BUILD_BINDIR)/jw-build-create-project.sh) jw-build-create-project-not-found) CREATE_PROJECT_SH ?= /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/jw-build-create-project.sh $(JW_BUILD_BINDIR)/jw-build-create-project.sh) jw-build-create-project-not-found)
@ -307,20 +309,20 @@ git-status:
git-pull: $(SSH_WRAPPER_SH) git-pull: $(SSH_WRAPPER_SH)
$(PGIT_SH) clone $(PGIT_SH_CLONE)
git-pull-mini: $(SSH_WRAPPER_SH) git-pull-mini: $(SSH_WRAPPER_SH)
PGIT_CLONE_PROJECTS="$(patsubst %/.git,%,$(wildcard $(addsuffix /.git,$(shell make -s build-order))))" $(PGIT_SH) clone PGIT_CLONE_PROJECTS="$(patsubst %/.git,%,$(wildcard $(addsuffix /.git,$(shell make -s build-order))))" $(PGIT_SH_CLONE)
git-pull-all: $(SSH_WRAPPER_SH) git-pull-all: $(SSH_WRAPPER_SH)
$(PGIT_SH) pull --all $(PGIT_SH) pull --all
git-clone: $(SSH_WRAPPER_SH) git-clone: $(SSH_WRAPPER_SH)
$(PGIT_SH) clone $(PGIT_SH_CLONE)
touch clone.done touch clone.done
git-clone-%: $(SSH_WRAPPER_SH) git-clone-%: $(SSH_WRAPPER_SH)
PGIT_CLONE_FROM_USER=$* $(PGIT_SH) clone PGIT_CLONE_FROM_USER=$* $(PGIT_SH_CLONE)
git-show-non-master-branches: git-show-non-master-branches:
@$(PGIT_SH) branch 2>&1 | \ @$(PGIT_SH) branch 2>&1 | \
@ -341,7 +343,7 @@ git-update-project-descriptions: $(SSH_WRAPPER_SH)
$(GIT_SRV_ADMIN_SH) -j update-descriptions all $(GIT_SRV_ADMIN_SH) -j update-descriptions all
git-pull-%: $(SSH_WRAPPER_SH) git-pull-%: $(SSH_WRAPPER_SH)
PGIT_CLONE_FROM_USER=$* $(PGIT_SH) clone PGIT_CLONE_FROM_USER=$* $(PGIT_SH_CLONE)
git-commit: git-commit:
$(PGIT_SH) commit $(PGIT_SH) commit
@ -361,5 +363,5 @@ pull.done: $(filter-out $(UNAVAILABLE_TARGETS), clone.done)
touch $@ touch $@
clone.done: $(filter-out $(UNAVAILABLE_TARGETS),$(SSH_WRAPPER_SH)) clone.done: $(filter-out $(UNAVAILABLE_TARGETS),$(SSH_WRAPPER_SH))
$(PGIT_SH) clone $(PGIT_SH_CLONE)
touch $@ touch $@