tup icon indicating copy to clipboard operation
tup copied to clipboard

Relax read/write restrictions for hidden directories when user asks for it

Open pkoper opened this issue 5 years ago • 0 comments

Problem: it is not possible to use "git" or "hg" commands in tup rules, because of the read/write access to hidden directories (.git/, .hg/)

Proposition: Allow read/write access to hidden directory name specified in tup configuration.

Rationale: tup could support a meta build system by allowing side effects, i.e. reading and writing to hidden directories. It would be possible to add external logging system for rebuilds that writes to hidden directories or, it would be possible to generate tup outputs based on "git"/"hg" commands.

Use case: Generate "version" file whenever tup recognizes changes in files: Tupdefault.lua

if io.open('.hg', 'r') then tup.rule(tup.glob('*'), '(hg summary;hg status) > version', {'version'}) end

Here "hg" command will check files in current directory and it will also read files from .hg/ directory (which is forbidden today).

Think of using time in tup outputs: Tupdefault.lua

if io.open('.hg', 'r') then tup.rule(tup.glob('*'), 'date > timestamp', {'timestamp'}) end

Today it is possible to use "date" in tup rules, but it is not possible to use "git" or "hg" in tup rules.

Proposed implementation details: tup should never traverse hidden directories (even if some hidden directory is explicitly allowed to be read/written by "git" or "hg" in tup rule)

pkoper avatar Mar 21 '20 02:03 pkoper