yast/ycp-killer — pull request #226 by dmajda (2013-04-22 09:42:21+00:00)
Title: Improve progress messages

Before this commit, progress messages were crude and sometimes wrong.
This was mostly the case for the "convert" command, which printed
something like this when converting:

$ ./yk convert add-on sshd
[1/2] Compiling add-on...
* src/clients/add-on.ycp OK
* src/clients/inst_add-on.ycp OK
* src/clients/vendor.ycp OK
* src/clients/inst_language_add-on.ycp OK
* src/clients/inst_add-on_software.ycp OK
* src/clients/add-on_proposal.ycp OK
* src/clients/add-on_auto.ycp OK
* src/include/add-on/misc.ycp OK
* src/include/add-on/add-on-workflow.ycp OK
[2/2] Compiling sshd...
. src/modules/Sshd.ycp OK
. src/modules/SshdCommandLine.ycp OK
* src/modules/Sshd.ycp OK
* src/modules/SshdCommandLine.ycp OK
* src/clients/sshd_auto.ycp OK
* src/clients/sshd.ycp OK
* src/include/sshd/wizards.ycp OK
* src/include/sshd/helps.ycp OK
* src/include/sshd/complex.ycp OK
* src/include/sshd/dialogs.ycp OK
* testsuite/tests/Sshd-SSHDOption.ycp OK
* testsuite/tests/Sshd-Modified.ycp OK
* testsuite/tests/ag_sshd.ycp OK

-----

Total OK: 20
Total EXCLUDED: 0
Total ERROR(ybc): 0
Total ERROR(y2r): 0
Total ERROR(ruby): 0
Total ERROR(other): 0

The phases of the conversion were not visible (which was bad when an
unexpected exception happened) and the description of what is going on
was wrong.

I decided to change the message structure a bit to fix this. At the top
level, only a generic line like "[1/5] Processing add-on:" is printed.
This is a responsitiblity of the CLI class, which iterates over modules.
At the second level, details about the current action are printed (e.g.
"Generating Makefiles...") with possible status info. This is the
responsibility of the YastModule class.

Output of the "convert" command now looks like this:

$ ./yk convert add-on sshd
[1/2] Processing add-on:
* Resetting... OK
* Restructuring... OK
* Patching... OK
* Converting src/clients/add-on.ycp... OK
* Converting src/clients/inst_add-on.ycp... OK
* Converting src/clients/vendor.ycp... OK
* Converting src/clients/inst_language_add-on.ycp... OK
* Converting src/clients/inst_add-on_software.ycp... OK
* Converting src/clients/add-on_proposal.ycp... OK
* Converting src/clients/add-on_auto.ycp... OK
* Converting src/include/add-on/misc.ycp... OK
* Converting src/include/add-on/add-on-workflow.ycp... OK
* Generating Makefiles... OK
* Packaging... OK
[2/2] Processing sshd:
* Resetting... OK
* Restructuring... OK
* Patching... OK
* Compiling src/modules/Sshd.ycp... OK
* Compiling src/modules/SshdCommandLine.ycp... OK
* Converting src/modules/Sshd.ycp... OK
* Converting src/modules/SshdCommandLine.ycp... OK
* Converting src/clients/sshd_auto.ycp... OK
* Converting src/clients/sshd.ycp... OK
* Converting src/include/sshd/wizards.ycp... OK
* Converting src/include/sshd/helps.ycp... OK
* Converting src/include/sshd/complex.ycp... OK
* Converting src/include/sshd/dialogs.ycp... OK
* Converting testsuite/tests/Sshd-SSHDOption.ycp... OK
* Converting testsuite/tests/Sshd-Modified.ycp... OK
* Converting testsuite/tests/ag_sshd.ycp... OK
* Generating Makefiles... OK
* Packaging... OK

-----

Total OK: 20
Total EXCLUDED: 0
Total ERROR(ybc): 0
Total ERROR(y2r): 0
Total ERROR(ruby): 0
Total ERROR(other): 0

Better, isn't it?