This commit is contained in:
aynic.os
2021-06-14 14:32:14 +02:00
parent 97cd91a020
commit f0c10a3082
7 changed files with 72 additions and 76 deletions
+10 -10
View File
@@ -6,7 +6,7 @@
subrepo-branch-delete: $(if $(DOCKER_RUN),myos-base) subrepo-check
ifneq ($(words $(BRANCH)),0)
$(call exec,[ $$(git ls-remote --heads $(REMOTE) $(BRANCH) 2>/dev/null |wc -l) -eq 1 ]) \
&& $(RUN) $(call exec,git push $(REMOTE) :$(BRANCH))
&& $(call exec,$(RUN) git push $(REMOTE) :$(BRANCH))
endif
# target subrepo-check: Define SUBREPO and REMOTE
@@ -34,15 +34,15 @@ subrepo-git-diff: myos-base subrepo-check
# target subrepo-git-fetch: Fetch git remote
.PHONY: subrepo-git-fetch
subrepo-git-fetch: myos-base subrepo-check
$(RUN) $(call exec,git fetch --prune $(REMOTE))
$(call exec,$(RUN) git fetch --prune $(REMOTE))
# target subrepo-tag-create-%: Create tag TAG to reference branch REMOTE/%
.PHONY: subrepo-tag-create-%
subrepo-tag-create-%: myos-base subrepo-check subrepo-git-fetch
ifneq ($(words $(TAG)),0)
$(call exec,[ $$(git ls-remote --tags $(REMOTE) $(TAG) |wc -l) -eq 0 ]) \
|| $(RUN) $(call exec,git push $(REMOTE) :refs/tags/$(TAG))
$(RUN) $(call exec,git push $(REMOTE) refs/remotes/subrepo/$(SUBREPO)/$*:refs/tags/$(TAG))
|| $(call exec,$(RUN) git push $(REMOTE) :refs/tags/$(TAG))
$(call exec,$(RUN) git push $(REMOTE) refs/remotes/subrepo/$(SUBREPO)/$*:refs/tags/$(TAG))
endif
# target subrepo-push: Push to subrepo
@@ -64,12 +64,12 @@ endif
$(call INFO,subrepo $(SUBREPO) already up to date); \
else \
if [ $(DELETE) -eq 1 ]; then \
$(RUN) $(call exec,git push $(REMOTE) :$(BRANCH)); \
$(RUN) $(call exec,git push $(REMOTE) refs/remotes/$(REMOTE)/master:refs/heads/$(BRANCH)); \
$(call exec,$(RUN) git push $(REMOTE) :$(BRANCH)); \
$(call exec,$(RUN) git push $(REMOTE) refs/remotes/$(REMOTE)/master:refs/heads/$(BRANCH)); \
fi; \
$(RUN) $(call exec,git subrepo fetch $(SUBREPO) -b $(BRANCH)); \
$(RUN) $(call exec,git subrepo push $(SUBREPO) -b $(BRANCH) $(UPDATE_SUBREPO_OPTIONS)); \
$(RUN) $(call exec,git subrepo clean $(SUBREPO)); \
$(call exec,$(RUN) git subrepo fetch $(SUBREPO) -b $(BRANCH)); \
$(call exec,$(RUN) git subrepo push $(SUBREPO) -b $(BRANCH) $(UPDATE_SUBREPO_OPTIONS)); \
$(call exec,$(RUN) git subrepo clean $(SUBREPO)); \
fi
# target subrepos-branch-delete: Fire APPS target
@@ -83,7 +83,7 @@ subrepos-tag-create-%: $(APPS) ;
# target subrepos-update: Fire APPS target and push updates to upstream
.PHONY: subrepos-update
subrepos-update: myos-base git-stash $(APPS) git-unstash ## Update subrepos
$(RUN) $(call exec,git push upstream $(BRANCH))
$(call exec,$(RUN) git push upstream $(BRANCH))
# target subrepo-update-%: Call subrepo-update target in folder %
.PHONY: subrepo-update-%