Hi,

I successfully tested Sergei's patch and can confirm it solves this bug.

I'm attaching a slightly modified version of his patch ready to be put
into debian/patches/.

Best wishes,
-- 
 .''`.   Philipp Huebner <[email protected]>
: :'  :  pgp fp: 6719 25C5 B8CD E74A 5225  3DF9 E5CA 8C49 25E4 205F
`. `'`
  `-
Description: fixes FTBFS in packages containing ~d in package name
Author: Sergei Golovan <[email protected]>
Bug-Debian: https://bugs.debian.org/840431

--- rebar-2.6.4.orig/src/rebar_port_compiler.erl
+++ rebar-2.6.4/src/rebar_port_compiler.erl
@@ -230,7 +230,7 @@ compile_sources(Config, Specs, SharedEnv
         _ ->
             {ok, ClangDbFile} = file:open("compile_commands.json", [write]),
             ok = io:fwrite(ClangDbFile, "[~n", []),
-            lists:foreach(fun(E) -> ok = io:fwrite(ClangDbFile, E, []) end, Db),
+            lists:foreach(fun(E) -> ok = io:fwrite(ClangDbFile, "~s", [E]) end, Db),
             ok = io:fwrite(ClangDbFile, "]~n", []),
             ok = file:close(ClangDbFile)
     end,
@@ -272,14 +272,14 @@ cdb_entry(Src, Cmd, SrcRest) ->
     %% If there are more source files, make sure we end the CDB entry
     %% with a comma.
     Sep = case SrcRest of
-              [] -> "~n";
-              _  -> ",~n"
+              [] -> "";
+              _  -> ","
           end,
     %% CDB entry
     ?FMT("{ \"file\"      : ~p~n"
          ", \"directory\" : ~p~n"
          ", \"command\"   : ~p~n"
-         "}~s",
+         "}~s~n",
          [Src, Cwd, CDBCmd, Sep]).
 
 exec_compiler(Config, Source, Cmd, ShOpts) ->

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to