When USES=dos2unix + DOS2UNIX_FILES is used, the list of files is passed to sed replacing command through extra echo, which makes it impossible to pass path with spaces (e.g. DOS2UNIX_FILES=foo\ bar\ baz/*.txt). Fix this by removing unneded echo
Details
Diff Detail
- Repository
- rP FreeBSD ports repository
- Lint
No Lint Coverage - Unit
No Test Coverage - Build Status
Buildable 815 Build 815: arc lint + arc unit
Event Timeline
The echo|xargs is there to prevent ARG_MAX problems.
Though, maybe people should use globs in that case.
That was my first idea, then I though it was silly, as it will overflow echo's max number of arguments the same way it may overflow sed's. However after you've mentioned it I started to suspect that the difference is in that echo is a builtin. After some more though it's apparent that it nevertheless still sends whole expanded argument list to sed (e.g. there's no -n argument to xargs), so there's no real functional change.
However it game me an idea that we may iterate over ${DOS2UNIX_FILES} and call sed multiple times.
Also I remembered that I also wanted to move this whole code from if/elif/else to if/if/if, so user may use files, regex and glob at the same time. What do you think?