Menu

#48 Non-portable use of sed(1) in Makefile

None
closed-fixed
nobody
None
5
2016-11-07
2015-03-14
No

When performing CRLF->LF conversion on rhashrc.sample file, it is done via sed -e 's/\x0D//g', which works with GNU sed(1), but not necessarily other implementations (e.g. it does not work on FreeBSD).

There is a better way to strip CR's, by using tr(1) instead, which should work practically everywhere. Consider the following pseudo-patch:

-       sed -e 's/\x0D//g' dist/rhashrc.sample > rc.tmp && $(INSTALL_DATA) ...
+       tr -d \\r < dist/rhashrc.sample > rc.tmp && $(INSTALL_DATA) ...

Discussion

  • Aleksey

    Aleksey - 2016-11-07
    • status: open --> closed-fixed
     
  • Aleksey

    Aleksey - 2016-11-07

    Fixed in v1.3.4

     

Log in to post a comment.

MongoDB Logo MongoDB