Skip to content

Commit 3fcb07b

Browse files
hmmrAndrei Zavada
authored andcommitted
rely on RIAK_PATH in scripts generated with make rel
Avoid backticks in platform_base_dir as this runs afoul of backtick substitutions down the line in scripts. Instead, read the value for platform_base_dir from RIAK_PATH (/opt/riak by default). This change only affects `make rel`; specifically, if you want to run ./rel/riak/bin/riak-admin right from the source tree, you will have to set RIAK_PATH to `pwd`/rel/riak first.
1 parent 2dddb56 commit 3fcb07b

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ test : testclean eunit test-deps
7676
rel: compile
7777
@$(REBAR) as rel release
7878
# freebsd tar won't write to stdout, so
79-
@tar -c -f rel.tar --exclude '*/.git/*' -C _build/rel/rel riak && tar -x -f rel.tar -C rel && rm rel.tar
79+
@tar -c -f rel.tar --exclude-vcs -C _build/rel/rel riak && tar -x -f rel.tar -C rel && rm rel.tar
8080

8181
rel-rpm: compile
8282
@$(REBAR) as rpm release
83-
@tar --exclude='*/.git/*' -c -C _build/rpm/rel riak | tar -x -C rel
83+
@tar --exclude-vcs -c -C _build/rpm/rel riak | tar -x -C rel
8484

8585
rel-deb: compile
8686
@$(REBAR) as deb release
87-
@tar --exclude='*/.git/*' -c -C _build/deb/rel riak | tar -x -C rel
87+
@tar --exclude=vcs -c -C _build/deb/rel riak | tar -x -C rel
8888

8989
relclean:
9090
@rm -rf $(REL_DIR)

rel/files/riak-admin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SCRIPT="riak-admin"
77

88
RPC_HOP="{{platform_bin_dir}}/riak rpc"
99

10-
ERTS_PATH="{{runner_base_dir}}/`(cd {{runner_base_dir}} && ls -d erts-*)`/bin"
10+
ERTS_PATH="{{platform_base_dir}}/`(cd {{platform_base_dir}} && ls -d erts-*)`/bin"
1111
COOKIE=`egrep '^[ \t]*distributed_cookie[ \t]*=[ \t]*' {{platform_etc_dir}}/riak.conf 2> /dev/null | cut -d = -f 2 | tr -d ' '`
1212
NODE={{node}}
1313
HOST=${NODE#*@}

rel/files/riak-debug

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ exit
136136
###
137137

138138
# These paths may be overridden with environment variables.
139-
RUNNER_BASE_DIR={{runner_base_dir}}
140-
riak_base_dir={{runner_base_dir}}
141-
riak_bin_dir={{runner_script_dir}}
142-
riak_etc_dir={{runner_etc_dir}}
139+
RUNNER_BASE_DIR=$(cd `dirname $0` && /bin/pwd -P)/..
140+
riak_base_dir=$RUNNER_BASE_DIR
141+
riak_bin_dir={{platform_script_dir}}
142+
riak_etc_dir={{platform_etc_dir}}
143143
riak_sbin_dir=/usr/sbin
144144

145145
get_cfgs=0

rel/vars.config

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
{rel_vsn, "{{release_version}}"}.
55

66
%% Platform-specific installation paths
7-
{platform_bin_dir, "./bin"}.
8-
{platform_data_dir, "./data"}.
9-
{platform_etc_dir, "./etc"}.
10-
{platform_lib_dir, "./lib"}.
11-
{platform_log_dir, "./log"}.
12-
{platform_gen_dir, "./releases/{{release_version}}"}.
7+
{platform_base_dir, "${RIAK_PATH:-/opt/riak}"}.
8+
{platform_bin_dir, "{{platform_base_dir}}/bin"}.
9+
{platform_data_dir, "{{platform_base_dir}}/data"}.
10+
{platform_etc_dir, "{{platform_base_dir}}/etc"}.
11+
{platform_lib_dir, "{{platform_base_dir}}/lib"}.
12+
{platform_log_dir, "{{platform_base_dir}}/log"}.
13+
{platform_gen_dir, "{{platform_base_dir}}/releases/{{release_version}}"}.
1314

1415
%%
1516
%% etc/app.config

0 commit comments

Comments
 (0)