Issues

Issue #33 resolved

Failing to clean a group of task(s) with sub-tasks

José Esteves
created an issue

Illustrating the issue with the attached dodo files:

  1. In the case of dodo1.py, where "muppets" is (via 'task_dep') a group of 2 tasks ("gonzo", "kermit"), doit clean works as expected.

  2. In dodo2.py, with "muppets" as a task with sub-tasks ("muppets:gonzo", "muppets:kermit"), doit clean also succeeds.

  3. In dodo3.py, "muppets" is again defined as a task a with sub-tasks, and doit clean muppets still works. But, having defined "crowd" as a ('task-dep') group of one or more tasks (here only "muppets") doit clean crowd [and doit clean, with it as default] fails to trigger clean operations, even using option -c.

Comments (4)

  1. eduardo schettino repo owner

    Nice report :)

    sub-tasks are internally marked as a task_dep.

    So the bug is that the clean command is just checking for one level of task_dep, it should recurse to find all levels. As in your dodo3.py there are 2 levels it fails...

    It is an easy fix but i dont have time today :D. The "auto" cmd has a similar code without the same problem.

    https://bitbucket.org/schettino72/doit/src/c66bf6bcebe4889809656ae0249adbe75e54df56/doit/cmd_clean.py?at=default#cl-75

    https://bitbucket.org/schettino72/doit/src/c66bf6bcebe4889809656ae0249adbe75e54df56/doit/cmd_auto.py?at=default#cl-38

    This logic should be extracted probably with a generator finding all task deps...

    also:

    • should also include setup_tasks and calc_dep
    • same for commands forget and ignore
    • remove unused "include_setup" from control.py

    cheers,

    ps. brasileiro?

  2. Log in to comment