From 67fd36e884e39c92951a1c3d2135494f51d612f6 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 14 Sep 2018 17:19:55 +0200 Subject: [PATCH] testing: Avoid unnecessary rebuilds of components built from Git repos Installing apparently changes the timestamp on the repo dir triggering make to checkout and build the whole thing again. --- testing/scripts/recipes/005_anet.mk | 9 +++++---- testing/scripts/recipes/006_tkm-rpc.mk | 9 +++++---- testing/scripts/recipes/007_x509-ada.mk | 9 +++++---- testing/scripts/recipes/008_xfrm-ada.mk | 9 +++++---- testing/scripts/recipes/009_xfrm-proxy.mk | 9 +++++---- testing/scripts/recipes/010_tkm.mk | 9 +++++---- testing/scripts/recipes/011_botan.mk | 9 +++++---- 7 files changed, 35 insertions(+), 28 deletions(-) diff --git a/testing/scripts/recipes/005_anet.mk b/testing/scripts/recipes/005_anet.mk index a6af5df5c5..b311c0a99f 100644 --- a/testing/scripts/recipes/005_anet.mk +++ b/testing/scripts/recipes/005_anet.mk @@ -8,14 +8,15 @@ PREFIX = /usr/local/ada all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && make LIBRARY_KIND=static @touch $@ diff --git a/testing/scripts/recipes/006_tkm-rpc.mk b/testing/scripts/recipes/006_tkm-rpc.mk index 5f2e207c8e..ed2a62396e 100644 --- a/testing/scripts/recipes/006_tkm-rpc.mk +++ b/testing/scripts/recipes/006_tkm-rpc.mk @@ -10,14 +10,15 @@ export ADA_PROJECT_PATH=$(PREFIX)/lib/gnat all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && make @touch $@ diff --git a/testing/scripts/recipes/007_x509-ada.mk b/testing/scripts/recipes/007_x509-ada.mk index 7899f6dec6..57a106dea4 100644 --- a/testing/scripts/recipes/007_x509-ada.mk +++ b/testing/scripts/recipes/007_x509-ada.mk @@ -8,14 +8,15 @@ PREFIX = /usr/local/ada all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && make tests && make @touch $@ diff --git a/testing/scripts/recipes/008_xfrm-ada.mk b/testing/scripts/recipes/008_xfrm-ada.mk index ad1cbb2bc7..64ada0e45e 100644 --- a/testing/scripts/recipes/008_xfrm-ada.mk +++ b/testing/scripts/recipes/008_xfrm-ada.mk @@ -10,14 +10,15 @@ export ADA_PROJECT_PATH=$(PREFIX)/lib/gnat all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && make @touch $@ diff --git a/testing/scripts/recipes/009_xfrm-proxy.mk b/testing/scripts/recipes/009_xfrm-proxy.mk index a7c9d31cc2..bdf5b12116 100644 --- a/testing/scripts/recipes/009_xfrm-proxy.mk +++ b/testing/scripts/recipes/009_xfrm-proxy.mk @@ -8,14 +8,15 @@ export ADA_PROJECT_PATH=/usr/local/ada/lib/gnat all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && make @touch $@ diff --git a/testing/scripts/recipes/010_tkm.mk b/testing/scripts/recipes/010_tkm.mk index 03ee5b5267..2651660db6 100644 --- a/testing/scripts/recipes/010_tkm.mk +++ b/testing/scripts/recipes/010_tkm.mk @@ -8,14 +8,15 @@ export ADA_PROJECT_PATH=/usr/local/ada/lib/gnat all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && make @touch $@ diff --git a/testing/scripts/recipes/011_botan.mk b/testing/scripts/recipes/011_botan.mk index ef0f6d0660..e507f73102 100644 --- a/testing/scripts/recipes/011_botan.mk +++ b/testing/scripts/recipes/011_botan.mk @@ -15,14 +15,15 @@ CONFIG_OPTS = \ all: install -$(PKG): - git clone $(SRC) $(PKG) +.$(PKG)-cloned: + [ -d $(PKG) ] || git clone $(SRC) $(PKG) + @touch $@ -.$(PKG)-cloned-$(REV): $(PKG) +.$(PKG)-checkout-$(REV): .$(PKG)-cloned cd $(PKG) && git fetch && git checkout $(REV) @touch $@ -.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV) +.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) cd $(PKG) && python ./configure.py $(CONFIG_OPTS) && make -j $(NUM_CPUS) @touch $@