From: Stefan Bund Date: Wed, 28 Jul 2010 12:41:10 +0000 (+0200) Subject: Rework net/nonet buildout switching X-Git-Url: http://g0dil.de/git?p=zope-bootstrap.git;a=commitdiff_plain;h=7cea5e13f0111060fd35a407adafb38858aa0ad0 Rework net/nonet buildout switching --- diff --git a/Makefile.buildout b/Makefile.buildout index 47c5738..ee93fba 100644 --- a/Makefile.buildout +++ b/Makefile.buildout @@ -77,23 +77,29 @@ define buildout_opt _buildout_opt endef -buildout-net.cfg: buildout.cfg - @$(buildout_opt) buildout.cfg add buildout download_cache $(DLCACHE)/downloads - @$(buildout_opt) buildout.cfg add buildout extends-cache $(DLCACHE)/extends - @$(buildout_opt) buildout.cfg set buildout install_from_cache true - @$(buildout_opt) buildout.cfg set buildout newest true +buildout-net.cfg buildout-nonet.cfg: buildout.cfg mkdir -p $(DLCACHE)/downloads $(DLCACHE)/extends - @( \ - echo "[buildout]"; \ - echo "extends = buildout.cfg"; \ - echo "install-from-cache = false"; \ - echo "newest = true"; \ + @( \ + echo "[buildout]"; \ + echo "extends = buildout.cfg"; \ + echo "download-cache = $(DLCACHE)/downloads"; \ + echo "extends-cache = $(DLCACHE)/extends"; \ + echo "install-from-cache = true"; \ + echo "newest = false"; \ + ) > buildout-nonet.cfg + @( \ + echo "[buildout]"; \ + echo "extends = buildout.cfg"; \ + echo "download-cache = $(DLCACHE)/downloads"; \ + echo "extends-cache = $(DLCACHE)/extends"; \ + echo "install-from-cache = false"; \ + echo "newest = true"; \ ) > buildout-net.cfg BUILDOUT_OPTS = -c buildout-net.cfg -init-nonet: BUILDOUT_OPTS = -update-nonet: BUILDOUT_OPTS = +init-nonet: BUILDOUT_OPTS = -c buildout-nonet.cfg +update-nonet: BUILDOUT_OPTS = -c buildout-nonet.cfg bootstrap:: sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/* @@ -101,3 +107,5 @@ bootstrap:: .gitignore:: @$(gitignore) "/buildout-net.cfg" + @$(gitignore) "/buildout-nonet.cfg" + diff --git a/Makefile.master b/Makefile.master index bbd6344..c90ff03 100644 --- a/Makefile.master +++ b/Makefile.master @@ -62,20 +62,20 @@ default: shorthelp # # If the file exists in $(DLCACHE), it is retrieved from there instead. define httpget - _httpget() { \ - name="$${1##*/}"; \ - target="$$2"; \ - [ -n "$$target" ] || target="$$name"; \ - cache="$(DLCACHE)/$$name"; \ - if [ -r "$$cache" ]; then \ - echo "Fetching '$$name' from cache."; \ - else \ + _httpget() { \ + name="$${1##*/}"; \ + target="$$2"; \ + [ -n "$$target" ] || target="$$name"; \ + cache="$(DLCACHE)/$$name"; \ + if [ -r "$$cache" ]; then \ + echo "Fetching '$$name' from cache."; \ + else \ [ -z "$(HTTPGET_NONET)" ] || ( echo "Missing '$$1'."; exit 2 ); \ - echo "Downloading '$$1'."; \ - wget -O "$$cache" "$$1"; \ - fi; \ - cp "$$cache" "$$target"; \ - }; \ + echo "Downloading '$$1'."; \ + wget -O "$$cache" "$$1"; \ + fi; \ + cp "$$cache" "$$target"; \ + }; \ _httpget endef diff --git a/Makefile.zope3-buildout b/Makefile.zope3-buildout index 510ff66..f354821 100644 --- a/Makefile.zope3-buildout +++ b/Makefile.zope3-buildout @@ -22,7 +22,7 @@ buildout.cfg: eggs:: @$(install) zopeproject -buildout:: buildout.cfg buildout-net.cfg +buildout:: buildout.cfg buildout-net.cfg buildout-nonet.cfg bootstrap:: @[ -n "$(PROJECTNAME)" ] || (echo "PROJECTNAME not set"; exit 2)