erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Allow a {chmod, <perm>, <file>} overlay #587

Closed djnym closed 7 years ago

djnym commented 7 years ago

I find myself wanting to chmod a file to be executable which is being included in a release. I mistakenly thought since the overlay and rebar3 template syntax were so similar it would work to just add

{chmod, 8#00770, "path/to/file"}

but alas it did not. Is this something that would be acceptable to send as a change, or is this considered outside of the scope of relx?

lrascao commented 7 years ago

have you considered using the start/stop script hooks (described here: https://github.com/erlware/relx/pull/445)? the chmod'ing would take place when starting the release and not when generating it though

djnym commented 7 years ago

Yeah, that wouldn't work for me. What I'm doing is creating rpms so would like the chmoding to take place at or near the time of release, and before it's packaged. I basically created a provider which follows the tar phase of the release and uses epm to build an rpm (or deb, but I don't currently use debian). So I can work around and do the chmoding in my provider before I build the rpm, but it would be nice to be able to have the functionality more closely match the way templating is done. If there's no strong objections, I may submit a PR to allow for the chmoding, so let me know if there's any strong objections?

lrascao commented 7 years ago

sure, a PR would be great, can you support both modes for it, octal and symbolic?

djnym commented 7 years ago

Well, in the rebar3 templating it just wraps file:change_mode/2 which accepts an integer for it's second argument. The octal forms are just listed on that man page. So I'd probably just do that as there's not already a non-integer form in use. Also, it better matches the rebar3 templating.

lrascao commented 7 years ago

sure, that would be great

djnym commented 7 years ago

Okay, just submitted https://github.com/erlware/relx/pull/588

lrascao commented 7 years ago

closed via #588