CmdActions reference to dependencies, targets and changed dependencies
Bug #434327 reported by
schettino72
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
doit |
Fix Released
|
High
|
Philipp Tölke |
Bug Description
An action may now look like this:
"zip %(targets)s %(changed)s"
Related branches
lp:~toelke+lp/doit/onlychanged-bug
- schettino72: Approve
-
Diff: 194 lines4 files modifiedlib/doit/dependency.py (+7/-5)
lib/doit/runner.py (+2/-2)
lib/doit/task.py (+14/-4)
tests/test_dependency.py (+11/-11)
Changed in doit: | |
assignee: | nobody → Philipp Tölke (toelke+lp) |
importance: | Undecided → High |
milestone: | none → 0.4 |
status: | New → Confirmed |
Changed in doit: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
1) add an attribute "task" to Action. this way action has access to
it's task meta information. So on Task constructor we do:
for action in self.actions:
action.task = self
2) on Dependency. up_to_date return a list of changed dependencies. an
empty list would mean up-to-date.
3) on runner.py we would save the changed files in the task object: er.up_to_ date(task. name,
task. file_dep, task.targets, task.run_once)
task.dep_changed = dependencyManag
4) finally on CmdAction we would build the dict from the task data
action = self.action % {'targets': " ".join( self.task. targets) ,
' changed' : " ".join( self.task. dep_changed) ,
' dependencies' : " ".join( self.task. dependencies) }