From 132dce8b3ffdcbbf8e5d7e262c61f3565ee4641f Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 28 Jan 2026 07:56:33 +0100 Subject: [PATCH] jw-projects.py: Rename it to jw-pkg.py jw-projects.py is now a multi-call executable, with "projects" being just one of its subcommands. Rename it to jw-pkg.py to reflect that. Signed-off-by: Jan Lindemann --- make/projects-dir-minimal.mk | 4 ++-- make/projects-dir.mk | 29 ++++++++++++++------------- make/projects.mk | 4 +++- make/topdir.mk | 2 +- scripts/create-mkspec.sh | 2 +- scripts/{jw-projects.py => jw-pkg.py} | 0 scripts/pgit.sh | 2 +- 7 files changed, 23 insertions(+), 20 deletions(-) rename scripts/{jw-projects.py => jw-pkg.py} (100%) diff --git a/make/projects-dir-minimal.mk b/make/projects-dir-minimal.mk index 7130e9ea..63cacf2f 100644 --- a/make/projects-dir-minimal.mk +++ b/make/projects-dir-minimal.mk @@ -22,7 +22,7 @@ Q ?= @ ifeq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined) ifneq ($(wildcard $(JWBDIR)),) - PROJECTS_DIR_REMOTE_BASE := $(shell /usr/bin/python3 $(JWBDIR)/scripts/jw-projects.py -p . projects get-auth-info --remote-base --only-values) + PROJECTS_DIR_REMOTE_BASE := $(shell /usr/bin/python3 $(JWBDIR)/scripts/jw-pkg.py -p . projects get-auth-info --remote-base --only-values) endif ifeq ($(PROJECTS_DIR_REMOTE_BASE),) PROJECTS_DIR_REMOTE_BASE := https://janware.com/code @@ -44,7 +44,7 @@ endif ifeq ($(JANWARE_USER),) ifneq ($(wildcard $(JWBDIR)),) - JANWARE_USER := $(shell /usr/bin/python3 $(JWBDIR)/scripts/jw-projects.py -p . projects get-auth-info --username --only-values) + JANWARE_USER := $(shell /usr/bin/python3 $(JWBDIR)/scripts/jw-pkg.py -p . projects get-auth-info --username --only-values) endif endif diff --git a/make/projects-dir.mk b/make/projects-dir.mk index 4c9ee746..c6c3fbcb 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -97,7 +97,7 @@ ifeq ($(filter pkg-%,$(MAKECMDGOALS)),) endif ifneq ($(EXCLUDE_FROM_BUILD),) - PROJECTS_PY_EXTRA_BUILD_OPTS += --exclude "$(EXCLUDE_FROM_BUILD)" + JW_PKG_PY_EXTRA_BUILD_OPTS += --exclude "$(EXCLUDE_FROM_BUILD)" endif # non-interactive mode @@ -116,8 +116,9 @@ ifeq ($(TIME),) TIME += -p endif endif -PROJECTS_PY = $(TIME) python3 $(JWB_SCRIPT_DIR)/jw-projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS) projects -PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_OPTS) +JW_PKG_PY = $(TIME) python3 $(JWB_SCRIPT_DIR)/jw-pkg.py --prefix $(shell pwd) $(JW_PKG_PY_EXTRA_OPTS) +JW_PKG_PY_PROJECTS = $(JW_PKG_PY) projects +JW_PKG_PY_BUILD = $(JW_PKG_PY_PRJECTS) build $(JW_PKG_PY_EXTRA_BUILD_OPTS) PGIT_SH := /bin/bash $(JWB_SCRIPT_DIR)/pgit.sh ifneq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined) @@ -147,7 +148,7 @@ GIT_SRV_ADMIN_SH = JW_PKG_SSH_EXTRA_OPTS="$(JW_PKG_SSH_EXTRA_OPTS)" # ------------ projects to be built TARGET_PROJECTS = $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS)) -BUILD_PROJECTS = $(shell $(PROJECTS_PY_BUILD) --build-order all $(TARGET_PROJECTS)) +BUILD_PROJECTS = $(shell $(JW_PKG_PY_BUILD) --build-order all $(TARGET_PROJECTS)) GIT_PROJECTS = $(patsubst %/,%,$(dir $(wildcard $(addsuffix /.git,$(BUILD_PROJECTS))))) # ------------ targets @@ -155,7 +156,7 @@ GIT_PROJECTS = $(patsubst %/,%,$(dir $(wildcard $(addsuffix /.gi # --- mandatory targets all: $(filter-out $(UNAVAILABLE_TARGETS),pull.done) - $(PROJECTS_PY_BUILD) $@ $(TARGET_PROJECTS) + $(JW_PKG_PY_BUILD) $@ $(TARGET_PROJECTS) clean: clean-dirs distclean: clean-all-dirs done.clean install: @@ -180,18 +181,18 @@ help doc-project doc-module: status: $(SSH_WRAPPER_SH) build-order-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done) - $(PROJECTS_PY_BUILD) --build-order $* $(TARGET_PROJECTS) | sed 's/ */\n/g' + $(JW_PKG_PY_BUILD) --build-order $* $(TARGET_PROJECTS) | sed 's/ */\n/g' build-order: build-order-all echo-build-deps: - $(Q)$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS) + $(Q)$(JW_PKG_PY_PROJECTS) required-os-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS) echo-install-deps: - $(Q)$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run" $(TARGET_PROJECTS) + $(Q)$(JW_PKG_PY_PROJECTS) required-os-pkg --skip-excluded --flavours "build run" $(TARGET_PROJECTS) echo-release-deps: - $(Q)$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS) + $(Q)$(JW_PKG_PY_PROJECTS) required-os-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS) echo-os: $(Q)$(GET_OS_SH) @@ -243,10 +244,10 @@ pkg-manager-refresh: $(PKG_MANAGER_SH) refresh $(DASH_Y) pkg-install-build-deps: - $(PKG_MANAGER_SH) install $(DASH_Y) "$(BASE_PKGS) $(shell $(PROJECTS_PY) required-os-pkg --skip-excluded --flavours build $(TARGET_PROJECTS))" + $(PKG_MANAGER_SH) install $(DASH_Y) "$(BASE_PKGS) $(shell $(JW_PKG_PY_PROJECTS) required-os-pkg --skip-excluded --flavours build $(TARGET_PROJECTS))" pkg-install-release-deps: - $(PKG_MANAGER_SH) install $(DASH_Y) "$(BASE_PKGS) $(shell $(PROJECTS_PY) required-os-pkg --skip-excluded --flavours 'build run release' $(TARGET_PROJECTS))" + $(PKG_MANAGER_SH) install $(DASH_Y) "$(BASE_PKGS) $(shell $(JW_PKG_PY_PROJECTS) required-os-pkg --skip-excluded --flavours 'build run release' $(TARGET_PROJECTS))" pkg-release-reinstall: $(PREREQ_RELEASE) @@ -257,15 +258,15 @@ pkg-init-%: $(CREATE_PROJECT_SH) $* pkg-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done) - $(PROJECTS_PY_BUILD) $@ $(TARGET_PROJECTS) + $(JW_PKG_PY_BUILD) $@ $(TARGET_PROJECTS) # --- generic cleanup targets clean-dirs: - echo $(sort $(subst /,,$(dir $(wildcard */*.done)))) | xargs -r $(PROJECTS_PY_BUILD) clean + echo $(sort $(subst /,,$(dir $(wildcard */*.done)))) | xargs -r $(JW_PKG_PY_BUILD) clean clean-all-dirs: - $(PROJECTS_PY_BUILD) clean $(PROJECTS) + $(JW_PKG_PY_BUILD) clean $(PROJECTS) make clean-dirs purge: $(SSH_WRAPPER_SH) diff --git a/make/projects.mk b/make/projects.mk index 946aa503..9e710c90 100644 --- a/make/projects.mk +++ b/make/projects.mk @@ -29,8 +29,10 @@ endif include $(JWBDIR)/make/py-version.mk + ifneq ($(TOPDIR),) - proj_query_cmd = PYTHONPATH=$(JWBDIR)/src/python $(PYTHON) $(JWB_SCRIPT_DIR)/jw-projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format absolute $(PROJECTS_PY_EXTRA_OPTS) projects + JW_PKG_PY = PYTHONPATH=$(JWBDIR)/src/python $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format absolute $(JW_PKG_PY_EXTRA_OPTS) + proj_query_cmd = $(JW_PKG_PY) projects proj_query = $(shell $(proj_query_cmd) $(1)) proj_dir = $(call proj_query,proj-dir $(1)) htdocs_dir = $(call proj_query,htdocs-dir $(1)) diff --git a/make/topdir.mk b/make/topdir.mk index 29d7e713..09e3aac1 100644 --- a/make/topdir.mk +++ b/make/topdir.mk @@ -163,7 +163,7 @@ git-update-project-description: ssh $(JANWARE_USER)@git.janware.com "/opt/jw-pkg/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(PROJECT)" projects-%: - $(PYTHON) $(JWB_SCRIPT_DIR)/jw-projects.py projects build $* $(PROJECT) + $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py projects build $* $(PROJECT) install-deps-devel: sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//") diff --git a/scripts/create-mkspec.sh b/scripts/create-mkspec.sh index c1968a36..cf43b5f8 100644 --- a/scripts/create-mkspec.sh +++ b/scripts/create-mkspec.sh @@ -41,7 +41,7 @@ subpackage_description() os_cascade() { - /usr/bin/python3 $JWB_SCRIPT_DIR/jw-projects.py projects os-cascade + /usr/bin/python3 $JWB_SCRIPT_DIR/jw-pkg.py projects os-cascade } # -- here we go diff --git a/scripts/jw-projects.py b/scripts/jw-pkg.py similarity index 100% rename from scripts/jw-projects.py rename to scripts/jw-pkg.py diff --git a/scripts/pgit.sh b/scripts/pgit.sh index 1a643e97..cfb9dd71 100644 --- a/scripts/pgit.sh +++ b/scripts/pgit.sh @@ -109,7 +109,7 @@ clone() local projects="$PGIT_CLONE_PROJECTS" local ignore="$PGIT_IGNORE" local thisdir="${0%/*}" - local jw_projects="/usr/bin/python3 $thisdir/jw-projects.py" + local jw_projects="/usr/bin/python3 $thisdir/jw-pkg.py" local create_remote_user_repos=false local long_opts="create-remote-user-repos" local refspec=()