mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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 <jan@janware.com>
This commit is contained in:
parent
1154cb984c
commit
132dce8b3f
7 changed files with 23 additions and 20 deletions
|
|
@ -22,7 +22,7 @@ Q ?= @
|
||||||
|
|
||||||
ifeq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
|
ifeq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
|
||||||
ifneq ($(wildcard $(JWBDIR)),)
|
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
|
endif
|
||||||
ifeq ($(PROJECTS_DIR_REMOTE_BASE),)
|
ifeq ($(PROJECTS_DIR_REMOTE_BASE),)
|
||||||
PROJECTS_DIR_REMOTE_BASE := https://janware.com/code
|
PROJECTS_DIR_REMOTE_BASE := https://janware.com/code
|
||||||
|
|
@ -44,7 +44,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(JANWARE_USER),)
|
ifeq ($(JANWARE_USER),)
|
||||||
ifneq ($(wildcard $(JWBDIR)),)
|
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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ ifeq ($(filter pkg-%,$(MAKECMDGOALS)),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(EXCLUDE_FROM_BUILD),)
|
ifneq ($(EXCLUDE_FROM_BUILD),)
|
||||||
PROJECTS_PY_EXTRA_BUILD_OPTS += --exclude "$(EXCLUDE_FROM_BUILD)"
|
JW_PKG_PY_EXTRA_BUILD_OPTS += --exclude "$(EXCLUDE_FROM_BUILD)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# non-interactive mode
|
# non-interactive mode
|
||||||
|
|
@ -116,8 +116,9 @@ ifeq ($(TIME),)
|
||||||
TIME += -p
|
TIME += -p
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
PROJECTS_PY = $(TIME) python3 $(JWB_SCRIPT_DIR)/jw-projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS) projects
|
JW_PKG_PY = $(TIME) python3 $(JWB_SCRIPT_DIR)/jw-pkg.py --prefix $(shell pwd) $(JW_PKG_PY_EXTRA_OPTS)
|
||||||
PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_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
|
PGIT_SH := /bin/bash $(JWB_SCRIPT_DIR)/pgit.sh
|
||||||
ifneq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
|
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
|
# ------------ projects to be built
|
||||||
|
|
||||||
TARGET_PROJECTS = $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS))
|
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)))))
|
GIT_PROJECTS = $(patsubst %/,%,$(dir $(wildcard $(addsuffix /.git,$(BUILD_PROJECTS)))))
|
||||||
|
|
||||||
# ------------ targets
|
# ------------ targets
|
||||||
|
|
@ -155,7 +156,7 @@ GIT_PROJECTS = $(patsubst %/,%,$(dir $(wildcard $(addsuffix /.gi
|
||||||
# --- mandatory targets
|
# --- mandatory targets
|
||||||
|
|
||||||
all: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
|
all: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
|
||||||
$(PROJECTS_PY_BUILD) $@ $(TARGET_PROJECTS)
|
$(JW_PKG_PY_BUILD) $@ $(TARGET_PROJECTS)
|
||||||
clean: clean-dirs
|
clean: clean-dirs
|
||||||
distclean: clean-all-dirs done.clean
|
distclean: clean-all-dirs done.clean
|
||||||
install:
|
install:
|
||||||
|
|
@ -180,18 +181,18 @@ help doc-project doc-module:
|
||||||
status: $(SSH_WRAPPER_SH)
|
status: $(SSH_WRAPPER_SH)
|
||||||
|
|
||||||
build-order-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
|
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
|
build-order: build-order-all
|
||||||
|
|
||||||
echo-build-deps:
|
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:
|
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:
|
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:
|
echo-os:
|
||||||
$(Q)$(GET_OS_SH)
|
$(Q)$(GET_OS_SH)
|
||||||
|
|
||||||
|
|
@ -243,10 +244,10 @@ pkg-manager-refresh:
|
||||||
$(PKG_MANAGER_SH) refresh $(DASH_Y)
|
$(PKG_MANAGER_SH) refresh $(DASH_Y)
|
||||||
|
|
||||||
pkg-install-build-deps:
|
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-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)
|
pkg-release-reinstall: $(PREREQ_RELEASE)
|
||||||
|
|
||||||
|
|
@ -257,15 +258,15 @@ pkg-init-%:
|
||||||
$(CREATE_PROJECT_SH) $*
|
$(CREATE_PROJECT_SH) $*
|
||||||
|
|
||||||
pkg-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
|
pkg-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
|
||||||
$(PROJECTS_PY_BUILD) $@ $(TARGET_PROJECTS)
|
$(JW_PKG_PY_BUILD) $@ $(TARGET_PROJECTS)
|
||||||
|
|
||||||
# --- generic cleanup targets
|
# --- generic cleanup targets
|
||||||
|
|
||||||
clean-dirs:
|
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:
|
clean-all-dirs:
|
||||||
$(PROJECTS_PY_BUILD) clean $(PROJECTS)
|
$(JW_PKG_PY_BUILD) clean $(PROJECTS)
|
||||||
make clean-dirs
|
make clean-dirs
|
||||||
|
|
||||||
purge: $(SSH_WRAPPER_SH)
|
purge: $(SSH_WRAPPER_SH)
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,10 @@ endif
|
||||||
|
|
||||||
include $(JWBDIR)/make/py-version.mk
|
include $(JWBDIR)/make/py-version.mk
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(TOPDIR),)
|
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_query = $(shell $(proj_query_cmd) $(1))
|
||||||
proj_dir = $(call proj_query,proj-dir $(1))
|
proj_dir = $(call proj_query,proj-dir $(1))
|
||||||
htdocs_dir = $(call proj_query,htdocs-dir $(1))
|
htdocs_dir = $(call proj_query,htdocs-dir $(1))
|
||||||
|
|
|
||||||
|
|
@ -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)"
|
ssh $(JANWARE_USER)@git.janware.com "/opt/jw-pkg/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(PROJECT)"
|
||||||
|
|
||||||
projects-%:
|
projects-%:
|
||||||
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-projects.py projects build $* $(PROJECT)
|
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py projects build $* $(PROJECT)
|
||||||
|
|
||||||
install-deps-devel:
|
install-deps-devel:
|
||||||
sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//")
|
sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//")
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ subpackage_description()
|
||||||
|
|
||||||
os_cascade()
|
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
|
# -- here we go
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ clone()
|
||||||
local projects="$PGIT_CLONE_PROJECTS"
|
local projects="$PGIT_CLONE_PROJECTS"
|
||||||
local ignore="$PGIT_IGNORE"
|
local ignore="$PGIT_IGNORE"
|
||||||
local thisdir="${0%/*}"
|
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 create_remote_user_repos=false
|
||||||
local long_opts="create-remote-user-repos"
|
local long_opts="create-remote-user-repos"
|
||||||
local refspec=()
|
local refspec=()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue