You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/09/25 21:23:00 UTC
couch commit: updated refs/heads/master to d2a5c03
Repository: couchdb-couch
Updated Branches:
refs/heads/master 25b820e3e -> d2a5c034b
Only update config files when they differ
Overwriting these files unconditionally triggers metadata changes which
prevent the ability of creating identical tarballs.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/d2a5c034
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/d2a5c034
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/d2a5c034
Branch: refs/heads/master
Commit: d2a5c034b1bfd1143d49e65f3866fc5a0fd705e2
Parents: 25b820e
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Sep 25 14:21:38 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Thu Sep 25 14:22:53 2014 -0500
----------------------------------------------------------------------
rebar.config.script | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/d2a5c034/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index aa86df8..747c4d0 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -10,6 +10,21 @@
%% License for the specific language governing permissions and limitations under
%% the License.
+CopyIfDifferent = fun(Path, Contents) ->
+ case filelib:is_file(Path) of
+ true ->
+ case file:read_file(Path) of
+ {ok, Contents} ->
+ ok;
+ _ ->
+ file:write_file(Path, Contents)
+ end;
+ false ->
+ file:write_file(Path, Contents)
+ end
+end,
+
+
CouchJSName = case os:type() of
{win32, _} ->
"couchjs.exe";
@@ -39,8 +54,10 @@ ConfigH = [
{"PACKAGE_VERSION", "\"" ++ Version ++ "\""}
],
+CouchJSConfig = "priv/couch_js/config.h",
ConfigSrc = [["#define ", K, " ", V, $\n] || {K, V} <- ConfigH],
-ok = file:write_file("priv/couch_js/config.h", ConfigSrc),
+ConfigBin = iolist_to_binary(ConfigSrc),
+ok = CopyIfDifferent(CouchJSConfig, ConfigBin),
{JS_CFLAGS, JS_LDFLAGS} = case lists:keyfind(with_curl, 1, CouchConfig) of
{with_curl, true} ->
@@ -87,8 +104,8 @@ PortSpecs = case os:type() of
{win32, _} ->
BaseSpecs ++ SpawnSpec;
_ ->
- {ok, _} = file:copy("priv/spawnkillable/couchspawnkillable.sh",
- "priv/couchspawnkillable"),
+ {ok, CSK} = file:read_file("priv/spawnkillable/couchspawnkillable.sh"),
+ ok = CopyIfDifferent("priv/couchspawnkillable", CSK),
os:cmd("chmod +x priv/couchspawnkillable"),
BaseSpecs
end,