diff --git a/pkg/ccn-lite/Makefile b/pkg/ccn-lite/Makefile index 6c81e3f5bc..4a15a283f0 100644 --- a/pkg/ccn-lite/Makefile +++ b/pkg/ccn-lite/Makefile @@ -20,10 +20,7 @@ all: $(PKG_DIR)/Makefile $(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && \ - git remote set-url origin "$(PKG_URL)" && \ - git fetch && git checkout -f "$(PKG_VERSION)" + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" clean:: @echo "Cleaning up CCN-Lite package..." diff --git a/pkg/cmsis-dsp/Makefile b/pkg/cmsis-dsp/Makefile index 4c3d3d7f04..0c9510b6e4 100644 --- a/pkg/cmsis-dsp/Makefile +++ b/pkg/cmsis-dsp/Makefile @@ -16,12 +16,7 @@ $(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config @ $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && git checkout -f "$(PKG_VERSION)" - -$(CURDIR)/$(PKG_NAME) $(PKG_NAME): - # Get PKG_VERSION of package from PKG_URL - git clone '$(PKG_URL)' '$(PKG_NAME)' && cd '$(PKG_NAME)' && git reset --hard '$(PKG_VERSION)' + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" clean:: @echo "Cleaning up $(PKG_NAME) package..." diff --git a/pkg/libcoap/Makefile b/pkg/libcoap/Makefile index 6aaba12108..da32ccd41d 100644 --- a/pkg/libcoap/Makefile +++ b/pkg/libcoap/Makefile @@ -23,8 +23,7 @@ $(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config cd "$(PKG_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && git checkout -f "$(PKG_VERSION)" + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" clean:: @echo "Cleaning up libcoap package..." diff --git a/pkg/micro-ecc/Makefile b/pkg/micro-ecc/Makefile index f503bb84cf..c6d70b1e3b 100644 --- a/pkg/micro-ecc/Makefile +++ b/pkg/micro-ecc/Makefile @@ -30,8 +30,7 @@ $(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR) $(PKG_BUILDDIR): mkdir -p $(BINDIR)/pkg && \ - git clone $(PKG_URL) $@ && \ - cd $@ && git reset --hard $(PKG_VERSION) + $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_BUILDDIR)" clean:: rm -Rf $(PKG_BUILDDIR) diff --git a/pkg/microcoap/Makefile b/pkg/microcoap/Makefile index 4d2a4b6b0f..74ea27329e 100644 --- a/pkg/microcoap/Makefile +++ b/pkg/microcoap/Makefile @@ -23,8 +23,7 @@ $(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config cd "$(PKG_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && git checkout -f "$(PKG_VERSION)" + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" clean:: @echo "Cleaning up $(PKG_NAME) package..." diff --git a/pkg/oonf_api/Makefile b/pkg/oonf_api/Makefile index 7828eefa40..210933f84c 100644 --- a/pkg/oonf_api/Makefile +++ b/pkg/oonf_api/Makefile @@ -26,8 +26,7 @@ $(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config cd "$(PKG_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && git checkout -f "$(PKG_VERSION)" + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" clean:: @echo "Cleaning up oonf_api package..." diff --git a/pkg/openwsn/Makefile b/pkg/openwsn/Makefile index 13cd667fb9..57e46c8473 100644 --- a/pkg/openwsn/Makefile +++ b/pkg/openwsn/Makefile @@ -18,8 +18,7 @@ $(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config cd "$(PKG_DIR)" && git am --ignore-whitespace $(CURDIR)/*.patch $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && git checkout -f "$(PKG_VERSION)" + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" clean:: @echo "Cleaning up OpenWSN package..." @@ -33,4 +32,4 @@ distclean:: rm -rf "$(PKG_DIR)" Makefile.include: - @true \ No newline at end of file + @true diff --git a/pkg/relic/Makefile b/pkg/relic/Makefile index e27cae8164..96ed53a65b 100644 --- a/pkg/relic/Makefile +++ b/pkg/relic/Makefile @@ -27,8 +27,7 @@ $(PKG_DIR)/comp-options.cmake: $(PKG_DIR)/.git/config $(PKG_DIR)/Makefile: $(PKG_DIR)/comp-options.cmake cd "$(PKG_DIR)" && COMP="$(filter-out -Werror=old-style-definition -Werror=strict-prototypes, $(CFLAGS) ) " cmake -DCMAKE_TOOLCHAIN_FILE=comp-options.cmake -DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) . $(PKG_DIR)/.git/config: - test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ - cd "$(PKG_DIR)" && git checkout -f "$(PKG_VERSION)" + test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)" cd "$(PKG_DIR)" && git am --ignore-whitespace $(CURDIR)/*.patch ./fix-util_print_wo_args.sh . ./fix-old-style-definitions.sh . diff --git a/pkg/wakaama/Makefile b/pkg/wakaama/Makefile index 9c4b301417..72ed926bf3 100644 --- a/pkg/wakaama/Makefile +++ b/pkg/wakaama/Makefile @@ -15,9 +15,7 @@ $(PKG_DIR)/Makefile: $(PKG_TEMP_DIR)/.git/config echo 'include $$(RIOTBASE)/Makefile.base' > $(PKG_DIR)/Makefile $(PKG_TEMP_DIR)/.git/config: - test -d "$(PKG_TEMP_DIR)" || git clone "$(PKG_URL)" "$(PKG_TEMP_DIR)"; \ - cd "$(PKG_TEMP_DIR)" && git checkout -f "$(PKG_VERSION)"; \ - cd "$(PKG_TEMP_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch; \ + test -d "$(PKG_TEMP_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_TEMP_DIR)" ; \ mkdir -p "$(PKG_DIR)" ; \ cp $(PKG_TEMP_DIR)/core/*.c $(PKG_TEMP_DIR)/core/*.h $(PKG_DIR); \ cp $(PKG_TEMP_DIR)/core/er-coap-13/*.c $(PKG_TEMP_DIR)/core/er-coap-13/*.h $(PKG_DIR); \