mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:32:45 +01:00
makesystem: clone pkgs without history
there is no git clone left since git clone does not support getting specific commits ->: - init empty repo, - setup remote origin - configure - fetch - checkout
This commit is contained in:
parent
4a9130259a
commit
cc3fc8ebb7
13
pkg/pkg.mk
13
pkg/pkg.mk
@ -128,11 +128,24 @@ $(PKG_DOWNLOADED): $(MAKEFILE_LIST) | $(PKG_SOURCE_DIR)/.git
|
||||
fi
|
||||
echo $(PKG_VERSION) > $@
|
||||
|
||||
ifeq ($(GIT_CACHE_DIR),$(wildcard $(GIT_CACHE_DIR)))
|
||||
$(PKG_SOURCE_DIR)/.git: | $(PKG_CUSTOM_PREPARED)
|
||||
$(info [INFO] cloning $(PKG_NAME))
|
||||
$(Q)rm -Rf $(PKG_SOURCE_DIR)
|
||||
$(Q)mkdir -p $(PKG_SOURCE_DIR)
|
||||
$(Q)$(GITCACHE) clone $(PKG_URL) $(PKG_VERSION) $(PKG_SOURCE_DIR)
|
||||
else
|
||||
$(PKG_SOURCE_DIR)/.git: | $(PKG_CUSTOM_PREPARED)
|
||||
$(info [INFO] cloning without cache $(PKG_NAME))
|
||||
$(Q)rm -Rf $(PKG_SOURCE_DIR)
|
||||
$(Q)mkdir -p $(PKG_SOURCE_DIR)
|
||||
$(Q)git init -q $(PKG_SOURCE_DIR)
|
||||
$(Q)$(GIT_IN_PKG) remote add origin $(PKG_URL)
|
||||
$(Q)$(GIT_IN_PKG) config extensions.partialClone origin
|
||||
$(Q)$(GIT_IN_PKG) config advice.detachedHead false
|
||||
$(Q)$(GIT_IN_PKG) fetch --depth=1 -t --filter=blob:none origin $(PKG_VERSION)
|
||||
$(Q)$(GIT_IN_PKG) checkout $(PKG_VERSION)
|
||||
endif
|
||||
|
||||
ifeq ($(PKG_SOURCE_DIR),$(PKG_BUILD_DIR))
|
||||
# This is the case for packages that are built within their source directory
|
||||
|
Loading…
Reference in New Issue
Block a user