# -*- makefile -*- # Usage: # @$(buildout_opt) [set|add|append|remove]
[] # # Change setting for in
. Actions are # # set Set to replacing any existing value # add If is unset, set to # append Append to the end of the current value of # remove Remove any assignment to # define buildout_opt _buildout_getopt_() { \ sed -n -e "/^\[$$1\]/,/^\[/ba" -eb -e:a -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/p" $$cfgfile | \ sed -e '$$d'; \ }; \ _buildout_haveopt() { \ [ -n "`_buildout_getopt_ "$$1" "$$2"`" ]; \ }; \ _buildout_getopt() { \ _buildout_checkopt_ "$$1" "$$2" | -e '1s/[^=]* *= *//'; \ }; \ _buildout_addopt() { \ sed -i -e "/\[$$1\]/ba" -eb -e:a -ea\\ -e "$$2 = $$3" $$cfgfile; \ }; \ _buildout_replaceopt() { \ sed -i -e "/^\[$$1\]/,/^\[/ba" -eb -e:a \ -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/bb" -eb -e:b \ -e "/^$$2 *=/bc" -ebd -e:c \ -ec\\ -e "$$2 = $$3" -eb -e:d \ -e "/^\([^ \t]\|\$$\)/b" -ed \ $$cfgfile; \ }; \ _buildout_appendopt() { \ sed -i -e "/^\[$$1\]/,/^\[/ba" -eb -e:a \ -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/bb" -eb -e:b \ -e /^\([^ \t]\|$$\)/bc -eb -e:c \ -ei\\ -e " $$3" \ $$cfgfile; \ }; \ _buildout_removeopt() { \ sed -i -e "/^\[$$1\]/,/^\[/ba" -eb -e:a \ -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/bb" -eb -e:b \ -e "/^\([^ \t]\|\$$\)/b" -ed \ $$cfgfile; \ }; \ _buildout_opt_set() { \ if _buildout_haveopt "$$1" "$$2"; then \ _buildout_replaceopt "$$1" "$$2" "$$3"; \ else \ _buildout_addopt "$$1" "$$2" "$$3"; \ fi; \ }; \ _buildout_opt_add() { \ if ! _buildout_haveopt "$$1" "$$2"; then \ _buildout_addopt "$$1" "$$2" "$$3"; \ fi; \ }; \ _buildout_opt_append() { \ if builout_haveopt "$$1" "$$2"; then \ _buildout_appendopt "$$1" "$$2" "$$3"; \ else \ _buildouT_addopt "$$1" "$$2" "$$3"; \ fi; \ }; \ _builout_opt_remove() { \ if buildout_haveopt "$$1" "$$2"; then \ _buildout_removeopt "$$1" "$$2"; \ fi; \ }; \ _buildout_opt() { \ echo "$$1: option '[$$3]/$$4' $$2 '$$5'"; \ cfgfile="$$1"; \ _buildout_opt_$$2 "$$3" "$$4" "$$5"; \ }; \ _buildout_opt endef buildout-net.cfg buildout-nonet.cfg: buildout.cfg mkdir -p $(DLCACHE)/downloads $(DLCACHE)/extends @( \ 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 = -c buildout-nonet.cfg update-nonet: BUILDOUT_OPTS = -c buildout-nonet.cfg bootstrap:: sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/* $(PYTHON) -c 'from zc.buildout.buildout import main; main(["bootstrap"])' update:: bin/buildout $(BUILDOUT_OPTS) .gitignore:: @$(gitignore) "*.egg-info/" @$(gitignore) "/buildout-net.cfg" @$(gitignore) "/buildout-nonet.cfg" clean:: rm -f buildout-net.cfg buildout-nonet.cfg versions: @echo "# Add the following lines to [versions] in buildout.cfg to pin all packages" @bin/buildout -vvvvv | sed -ne 's/^Picked: //p' | sort | uniq .PHONY: versions fullhelp:: @echo " versions" @echo " Generate lines to be added to 'buildout.cfg' to pin all package" @echo " versions." @echo