Skip to content

Commit a95080f

Browse files
committed
merge default into bug21346
2 parents 218f552 + 79b4481 commit a95080f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1563
-776
lines changed

.hgignore

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
syntax: glob
22
*.beam
33
*~
4+
*.swp
5+
*.patch
46
erl_crash.dump
57

68
syntax: regexp
79
^cover/
810
^dist/
9-
^include/rabbit_framing.hrl$
10-
^src/rabbit_framing.erl$
11-
^rabbit.plt$
12-
^ebin/rabbit.app$
13-
^ebin/rabbit.rel$
14-
^ebin/rabbit.boot$
15-
^ebin/rabbit.script$
11+
^include/rabbit_framing\.hrl$
12+
^src/rabbit_framing\.erl$
13+
^rabbit\.plt$
14+
^ebin/rabbit\.(app|rel|boot|script)$
1615
^plugins/
1716
^priv/plugins/
1817

Makefile

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ PYTHON=python
2020

2121
ifndef USE_SPECS
2222
# our type specs rely on features / bug fixes in dialyzer that are
23-
# only available in R12B-3 upwards
23+
# only available in R13B upwards (R13B is eshell 5.7.1)
2424
#
2525
# NB: the test assumes that version number will only contain single digits
26-
USE_SPECS=$(shell if [ $$(erl -noshell -eval 'io:format(erlang:system_info(version)), halt().') \> "5.6.2" ]; then echo "true"; else echo "false"; fi)
26+
USE_SPECS=$(shell if [ $$(erl -noshell -eval 'io:format(erlang:system_info(version)), halt().') \> "5.7.0" ]; then echo "true"; else echo "false"; fi)
2727
endif
2828

2929
#other args: +native +"{hipe,[o3,verbose]}" -Ddebug=true +debug_info +no_strict_record_tests
@@ -39,9 +39,6 @@ AMQP_SPEC_JSON_PATH=$(AMQP_CODEGEN_DIR)/amqp-0.8.json
3939

4040
ERL_CALL=erl_call -sname $(RABBITMQ_NODENAME) -e
4141

42-
# for the moment we don't use boot files because they introduce a
43-
# dependency on particular versions of OTP applications
44-
#all: $(EBIN_DIR)/rabbit.boot
4542
all: $(TARGETS)
4643

4744
$(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(BEAM_TARGETS) generate_app
@@ -101,7 +98,8 @@ run-tests: all
10198
start-background-node:
10299
$(BASIC_SCRIPT_ENVIRONMENT_SETTINGS) \
103100
RABBITMQ_NODE_ONLY=true \
104-
./scripts/rabbitmq-server -detached; sleep 1
101+
RABBITMQ_SERVER_START_ARGS="$(RABBITMQ_SERVER_START_ARGS) -detached" \
102+
./scripts/rabbitmq-server ; sleep 1
105103

106104
start-rabbit-on-node: all
107105
echo "rabbit:start()." | $(ERL_CALL)
@@ -115,8 +113,11 @@ force-snapshot: all
115113
stop-node:
116114
-$(ERL_CALL) -q
117115

116+
# code coverage will be created for subdirectory "ebin" of COVER_DIR
117+
COVER_DIR=.
118+
118119
start-cover: all
119-
echo "cover:start(), rabbit_misc:enable_cover()." | $(ERL_CALL)
120+
echo "cover:start(), rabbit_misc:enable_cover([\"$(COVER_DIR)\"])." | $(ERL_CALL)
120121

121122
stop-cover: all
122123
echo "rabbit_misc:report_cover(), cover:stop()." | $(ERL_CALL)
@@ -136,7 +137,7 @@ srcdist: distclean
136137
sed -i.save 's/%%VSN%%/$(VERSION)/' $(TARGET_SRC_DIR)/ebin/rabbit_app.in && rm -f $(TARGET_SRC_DIR)/ebin/rabbit_app.in.save
137138

138139
cp -r $(AMQP_CODEGEN_DIR)/* $(TARGET_SRC_DIR)/codegen/
139-
cp codegen.py Makefile generate_app $(TARGET_SRC_DIR)
140+
cp codegen.py Makefile generate_app calculate-relative $(TARGET_SRC_DIR)
140141

141142
cp -r scripts $(TARGET_SRC_DIR)
142143
cp -r docs $(TARGET_SRC_DIR)
@@ -147,7 +148,7 @@ srcdist: distclean
147148
rm -rf $(TARGET_SRC_DIR)
148149

149150
distclean: clean
150-
make -C $(AMQP_CODEGEN_DIR) distclean
151+
$(MAKE) -C $(AMQP_CODEGEN_DIR) distclean
151152
rm -rf dist
152153
find . -regex '.*\(~\|#\|\.swp\|\.dump\)' -exec rm {} \;
153154

@@ -162,7 +163,8 @@ distclean: clean
162163

163164
docs_all: $(MANPAGES)
164165

165-
install: all docs_all
166+
install: SCRIPTS_REL_PATH=$(shell ./calculate-relative $(TARGET_DIR)/sbin $(SBIN_DIR))
167+
install: all docs_all install_dirs
166168
@[ -n "$(TARGET_DIR)" ] || (echo "Please set TARGET_DIR."; false)
167169
@[ -n "$(SBIN_DIR)" ] || (echo "Please set SBIN_DIR."; false)
168170
@[ -n "$(MAN_DIR)" ] || (echo "Please set MAN_DIR."; false)
@@ -171,13 +173,17 @@ install: all docs_all
171173
cp -r ebin include LICENSE LICENSE-MPL-RabbitMQ INSTALL $(TARGET_DIR)
172174

173175
chmod 0755 scripts/*
174-
mkdir -p $(SBIN_DIR)
175-
cp scripts/rabbitmq-server $(SBIN_DIR)
176-
cp scripts/rabbitmqctl $(SBIN_DIR)
177-
cp scripts/rabbitmq-multi $(SBIN_DIR)
176+
for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-multi rabbitmq-activate-plugins; do \
177+
cp scripts/$$script $(TARGET_DIR)/sbin; \
178+
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
179+
done
178180
for section in 1 5; do \
179181
mkdir -p $(MAN_DIR)/man$$section; \
180182
for manpage in docs/*.$$section.pod; do \
181183
cp docs/`basename $$manpage .pod`.gz $(MAN_DIR)/man$$section; \
182184
done; \
183185
done
186+
187+
install_dirs:
188+
mkdir -p $(SBIN_DIR)
189+
mkdir -p $(TARGET_DIR)/sbin

calculate-relative

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python
2+
#
3+
# relpath.py
4+
# R.Barran 30/08/2004
5+
# Retrieved from http://code.activestate.com/recipes/302594/
6+
7+
import os
8+
import sys
9+
10+
def relpath(target, base=os.curdir):
11+
"""
12+
Return a relative path to the target from either the current dir or an optional base dir.
13+
Base can be a directory specified either as absolute or relative to current dir.
14+
"""
15+
16+
if not os.path.exists(target):
17+
raise OSError, 'Target does not exist: '+target
18+
19+
if not os.path.isdir(base):
20+
raise OSError, 'Base is not a directory or does not exist: '+base
21+
22+
base_list = (os.path.abspath(base)).split(os.sep)
23+
target_list = (os.path.abspath(target)).split(os.sep)
24+
25+
# On the windows platform the target may be on a completely different drive from the base.
26+
if os.name in ['nt','dos','os2'] and base_list[0] <> target_list[0]:
27+
raise OSError, 'Target is on a different drive to base. Target: '+target_list[0].upper()+', base: '+base_list[0].upper()
28+
29+
# Starting from the filepath root, work out how much of the filepath is
30+
# shared by base and target.
31+
for i in range(min(len(base_list), len(target_list))):
32+
if base_list[i] <> target_list[i]: break
33+
else:
34+
# If we broke out of the loop, i is pointing to the first differing path elements.
35+
# If we didn't break out of the loop, i is pointing to identical path elements.
36+
# Increment i so that in all cases it points to the first differing path elements.
37+
i+=1
38+
39+
rel_list = [os.pardir] * (len(base_list)-i) + target_list[i:]
40+
if (len(rel_list) == 0):
41+
return "."
42+
return os.path.join(*rel_list)
43+
44+
if __name__ == "__main__":
45+
print(relpath(sys.argv[1], sys.argv[2]))

codegen.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ def genMethodId(m):
117117

118118
def genMethodHasContent(m):
119119
print "method_has_content(%s) -> %s;" % (m.erlangName(), str(m.hasContent).lower())
120+
121+
def genMethodIsSynchronous(m):
122+
hasNoWait = "nowait" in fieldNameList(m.arguments)
123+
if m.isSynchronous and hasNoWait:
124+
print "is_method_synchronous(#%s{nowait = NoWait}) -> not(NoWait);" % (m.erlangName())
125+
else:
126+
print "is_method_synchronous(#%s{}) -> %s;" % (m.erlangName(), str(m.isSynchronous).lower())
120127

121128
def genMethodFieldTypes(m):
122129
"""Not currently used - may be useful in future?"""
@@ -246,6 +253,7 @@ def genLookupException1(c,hardErrorBoolStr):
246253
247254
-export([method_id/1]).
248255
-export([method_has_content/1]).
256+
-export([is_method_synchronous/1]).
249257
-export([method_fieldnames/1]).
250258
-export([decode_method_fields/2]).
251259
-export([decode_properties/2]).
@@ -266,6 +274,9 @@ def genLookupException1(c,hardErrorBoolStr):
266274
for m in methods: genMethodHasContent(m)
267275
print "method_has_content(Name) -> exit({unknown_method_name, Name})."
268276

277+
for m in methods: genMethodIsSynchronous(m)
278+
print "is_method_synchronous(Name) -> exit({unknown_method_name, Name})."
279+
269280
for m in methods: genMethodFieldNames(m)
270281
print "method_fieldnames(Name) -> exit({unknown_method_name, Name})."
271282

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
=head1 NAME
2+
3+
rabbitmq-activate-plugins - command line tool for activating plugins
4+
in a RabbitMQ broker
5+
6+
=head1 SYNOPSIS
7+
8+
rabbitmq-activate-plugins
9+
10+
=head1 DESCRIPTION
11+
12+
RabbitMQ is an implementation of AMQP, the emerging standard for high
13+
performance enterprise messaging. The RabbitMQ server is a robust and
14+
scalable implementation of an AMQP broker.
15+
16+
rabbitmq-activate-plugins is a command line tool for activating
17+
plugins installed into the broker's plugins directory.
18+
19+
=head1 EXAMPLES
20+
21+
To activate all of the installed plugins in the current RabbitMQ install,
22+
execute:
23+
24+
rabbitmq-activate-plugins
25+
26+
=head1 SEE ALSO
27+
28+
L<rabbitmq.conf(5)>, L<rabbitmq-multi(1)>, L<rabbitmq-server(1)>,
29+
L<rabbitmqctl(1)>
30+
31+
=head1 AUTHOR
32+
33+
The RabbitMQ Team <[email protected]>
34+
35+
=head1 REFERENCES
36+
37+
RabbitMQ Web Site: L<http://www.rabbitmq.com>

docs/rabbitmq-multi.1.pod

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,30 @@ scalable implementation of an AMQP broker.
1515
rabbitmq-multi scripts allows for easy set-up of a cluster on a single
1616
machine.
1717

18-
See also rabbitmq-server(1) for configuration information.
18+
See also L<rabbitmq-server(1)> for configuration information.
1919

2020
=head1 COMMANDS
2121

22-
start_all I<count>
23-
start count nodes with unique names, listening on all IP addresses
24-
and on sequential ports starting from 5672.
22+
=over
2523

26-
status
27-
print the status of all running RabbitMQ nodes
24+
=item start_all I<count>
2825

29-
stop_all
30-
stop all local RabbitMQ nodes
26+
Start count nodes with unique names, listening on all IP addresses and
27+
on sequential ports starting from 5672.
3128

32-
rotate_logs
33-
rotate log files for all local and running RabbitMQ nodes
29+
=item status
30+
31+
Print the status of all running RabbitMQ nodes.
32+
33+
=item stop_all
34+
35+
Stop all local RabbitMQ nodes,
36+
37+
=item rotate_logs
38+
39+
Rotate log files for all local and running RabbitMQ nodes.
40+
41+
=back
3442

3543
=head1 EXAMPLES
3644

@@ -40,12 +48,12 @@ Start 3 local RabbitMQ nodes with unique, sequential port numbers:
4048

4149
=head1 SEE ALSO
4250

43-
rabbitmq.conf(5), rabbitmq-server(1), rabbitmqctl(1)
51+
L<rabbitmq.conf(5)>, L<rabbitmq-server(1)>, L<rabbitmqctl(1)>
4452

4553
=head1 AUTHOR
4654

4755
The RabbitMQ Team <[email protected]>
4856

4957
=head1 REFERENCES
5058

51-
RabbitMQ Web Site: http://www.rabbitmq.com
59+
RabbitMQ Web Site: L<http://www.rabbitmq.com>

docs/rabbitmq-server.1.pod

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,57 @@ Running rabbitmq-server in the foreground displays a banner message,
1616
and reports on progress in the startup sequence, concluding with the
1717
message "broker running", indicating that the RabbitMQ broker has been
1818
started successfully. To shut down the server, just terminate the
19-
process or use rabbitmqctl(1).
19+
process or use L<rabbitmqctl(1)>.
2020

2121
=head1 ENVIRONMENT
2222

23-
B<RABBITMQ_MNESIA_BASE>
24-
Defaults to /var/lib/rabbitmq/mnesia. Set this to the directory
25-
where Mnesia database files should be placed.
23+
=over
2624

27-
B<RABBITMQ_LOG_BASE>
28-
Defaults to /var/log/rabbitmq. Log files generated by the server
29-
will be placed in this directory.
25+
=item B<RABBITMQ_MNESIA_BASE>
3026

31-
B<RABBITMQ_NODENAME>
32-
Defaults to rabbit. This can be useful if you want to run more
33-
than one node per machine - B<RABBITMQ_NODENAME> should be unique
34-
per erlang-node-and-machine combination. See clustering on a
35-
single machine guide at
36-
http://www.rabbitmq.com/clustering.html#single-machine for
37-
details.
27+
Defaults to F</var/lib/rabbitmq/mnesia>. Set this to the directory where
28+
Mnesia database files should be placed.
3829

39-
B<RABBITMQ_NODE_IP_ADDRESS>
40-
Defaults to 0.0.0.0. This can be changed if you only want to bind
41-
to one network interface.
30+
=item B<RABBITMQ_LOG_BASE>
4231

43-
B<RABBITMQ_NODE_PORT>
44-
Defaults to 5672.
32+
Defaults to F</var/log/rabbitmq>. Log files generated by the server will
33+
be placed in this directory.
4534

46-
B<RABBITMQ_CLUSTER_CONFIG_FILE>
47-
Defaults to /etc/rabbitmq/rabbitmq_cluster.config. If this file is
48-
present it is used by the server to auto-configure a RabbitMQ
49-
cluster.
50-
See the clustering guide at http://www.rabbitmq.com/clustering.html
51-
for details.
35+
=item B<RABBITMQ_NODENAME>
36+
37+
Defaults to rabbit. This can be useful if you want to run more than
38+
one node per machine - B<RABBITMQ_NODENAME> should be unique per
39+
erlang-node-and-machine combination. See clustering on a single
40+
machine guide at
41+
L<http://www.rabbitmq.com/clustering.html#single-machine> for details.
42+
43+
=item B<RABBITMQ_NODE_IP_ADDRESS>
44+
45+
Defaults to 0.0.0.0. This can be changed if you only want to bind to
46+
one network interface.
47+
48+
=item B<RABBITMQ_NODE_PORT>
49+
50+
Defaults to 5672.
51+
52+
=item B<RABBITMQ_CLUSTER_CONFIG_FILE>
53+
54+
Defaults to F</etc/rabbitmq/rabbitmq_cluster.config>. If this file is
55+
present it is used by the server to auto-configure a RabbitMQ cluster.
56+
See the clustering guide at L<http://www.rabbitmq.com/clustering.html>
57+
for details.
58+
59+
=back
5260

5361
=head1 OPTIONS
5462

55-
B<-detached> start the server process in the background
63+
=over
64+
65+
=item B<-detached>
66+
67+
start the server process in the background
68+
69+
=back
5670

5771
=head1 EXAMPLES
5872

@@ -62,12 +76,13 @@ Run RabbitMQ AMQP server in the background:
6276

6377
=head1 SEE ALSO
6478

65-
rabbitmq.conf(5), rabbitmq-multi(1), rabbitmqctl(1)
79+
L<rabbitmq.conf(5)>, L<rabbitmq-multi(1)>, L<rabbitmqctl(1)>
6680

6781
=head1 AUTHOR
6882

6983
The RabbitMQ Team <[email protected]>
7084

7185
=head1 REFERENCES
7286

73-
RabbitMQ Web Site: http://www.rabbitmq.com
87+
RabbitMQ Web Site: L<http://www.rabbitmq.com>
88+

0 commit comments

Comments
 (0)