mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
git-submod.mk: Check a couple of variables before taking action
Add checks to the git-init-submod-remote target, to keep it from starting a job which fails halfway through Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
17244e9a3f
commit
640dc4ffad
1 changed files with 6 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ GIT_REPO_URL = ssh://$(JANWARE_USER_PREFIX)git.janware.com/srv/g
|
|||
SUBMOD_PATH = $(patsubst $(abspath $(TOPDIR))/%,%,$(abspath $(CWD)/$(SUBMOD_SRC_DIR)))
|
||||
SUB_GIT = git -C $(SUBMOD_SRC_DIR)
|
||||
|
||||
ifeq ($(wildcard $(SUBMOD_SRC_DIR)/.git),)
|
||||
ifneq ($(wildcard $(SUBMOD_SRC_DIR)/.git),)
|
||||
SUBMOD_PKG_NAME := $(shell $(SUB_GIT) remote -v | sed -n 's/^[a-zA-Z_]\+\s//; s/ *.*//; s%.*/%%; s%\.git%%; 1p')
|
||||
SUBMOD_MAIN_BRANCH := $(firstword $(shell $(SUB_GIT) branch --format '%(refname:lstrip=2)'))
|
||||
endif
|
||||
|
|
@ -27,6 +27,11 @@ clean:
|
|||
distclean:
|
||||
|
||||
git-init-submod-remote:
|
||||
[ "$(SUBMOD_PKG_NAME)" ] # SUBMOD_PKG_NAME
|
||||
[ "$(SUBMOD_MAIN_BRANCH)" ] # SUBMOD_MAIN_BRANCH
|
||||
[ "$(SUBMOD_SRC_DIR)" ] # SUBMOD_SRC_DIR
|
||||
[ "$(SUBMOD_PATH)" ] # SUBMOD_PATH
|
||||
[ "$(GIT_REPO_URL)" ] # GIT_REPO_URL
|
||||
$(GIT_SRV_ADMIN_SH) -F contrib create-repo $(SUBMOD_PKG_NAME)
|
||||
$(SUB_GIT) remote rename origin upstream
|
||||
$(SUB_GIT) remote set-url --push upstream no-push
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue