summaryrefslogtreecommitdiff
path: root/autopkg-head.mk
blob: a61c9640b3c79f28697f6df491d048e82510ab95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ifndef AUTOPKG_VARIANT
	$(error "Don't include autopkg-head.mk directly!")
endif

ifndef PKG_NAME
$(error You have to define PKG_NAME before pkgauto.mk include)
endif
ifndef PKG_SOURCE_URL
$(error You have to define PKG_SOURCE_URL before pkgauto.mk include)
endif

TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME)
GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare

# Clone/update git history to bare repository
$(info $(shell \
	if [ ! -d "$(TMP_REPO_PATH)" ]; then \
		git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \
	else \
		git $(GIT_ARGS) remote update origin; \
	fi))