4 # @$(buildout_opt) <cfg-file> [set|add|append|remove] <section> <variable> [<value>]
6 # Change setting for <variable> in <section>. Actions are
8 # set Set <variable> to <value> replacing any existing value
9 # add If <variable> is unset, set to <value>
10 # append Append <value> to the end of the current value of <variable>
11 # remove Remove any assignment to <variable>
14 _buildout_getopt_() { \
15 sed -n -e "/^\[$$1\]/,/^\[/ba" -eb -e:a -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/p" $$cfgfile | \
18 _buildout_haveopt() { \
19 [ -n "`_buildout_getopt_ "$$1" "$$2"`" ]; \
21 _buildout_getopt() { \
22 _buildout_checkopt_ "$$1" "$$2" | -e '1s/[^=]* *= *//'; \
24 _buildout_addopt() { \
25 sed -i -e "/\[$$1\]/ba" -eb -e:a -ea\\ -e "$$2 = $$3" $$cfgfile; \
27 _buildout_replaceopt() { \
28 sed -i -e "/^\[$$1\]/,/^\[/ba" -eb -e:a \
29 -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/bb" -eb -e:b \
30 -e "/^$$2 *=/bc" -ebd -e:c \
31 -ec\\ -e "$$2 = $$3" -eb -e:d \
32 -e "/^\([^ \t]\|\$$\)/b" -ed \
35 _buildout_appendopt() { \
36 sed -i -e "/^\[$$1\]/,/^\[/ba" -eb -e:a \
37 -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/bb" -eb -e:b \
38 -e /^\([^ \t]\|$$\)/bc -eb -e:c \
42 _buildout_removeopt() { \
43 sed -i -e "/^\[$$1\]/,/^\[/ba" -eb -e:a \
44 -e "/^$$2 *=/,/^\([^ \t]\|\$$\)/bb" -eb -e:b \
45 -e "/^\([^ \t]\|\$$\)/b" -ed \
48 _buildout_opt_set() { \
49 if _buildout_haveopt "$$1" "$$2"; then \
50 _buildout_replaceopt "$$1" "$$2" "$$3"; \
52 _buildout_addopt "$$1" "$$2" "$$3"; \
55 _buildout_opt_add() { \
56 if ! _buildout_haveopt "$$1" "$$2"; then \
57 _buildout_addopt "$$1" "$$2" "$$3"; \
60 _buildout_opt_append() { \
61 if builout_haveopt "$$1" "$$2"; then \
62 _buildout_appendopt "$$1" "$$2" "$$3"; \
64 _buildouT_addopt "$$1" "$$2" "$$3"; \
67 _builout_opt_remove() { \
68 if buildout_haveopt "$$1" "$$2"; then \
69 _buildout_removeopt "$$1" "$$2"; \
73 echo "$$1: option '[$$3]/$$4' $$2 '$$5'"; \
75 _buildout_opt_$$2 "$$3" "$$4" "$$5"; \
80 buildout-net.cfg: buildout.cfg
81 @$(buildout_opt) buildout.cfg add buildout download_cache $(DLCACHE)/downloads
82 @$(buildout_opt) buildout.cfg add buildout extends-cache $(DLCACHE)/extends
83 @$(buildout_opt) buildout.cfg set buildout install_from_cache true
84 @$(buildout_opt) buildout.cfg set buildout newest true
85 mkdir -p $(DLCACHE)/downloads $(DLCACHE)/extends
88 echo "extends = buildout.cfg"; \
89 echo "install-from-cache = false"; \
90 echo "newest = true"; \
93 BUILDOUT_OPTS = -c buildout-net.cfg
95 init-nonet: BUILDOUT_OPTS =
96 update-nonet: BUILDOUT_OPTS =
99 sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
100 $(PYTHON) -c 'from zc.buildout.buildout import main; main(["bootstrap"])'
103 @$(gitignore) "/buildout-net.cfg"