Add a --print-modules command line option.

Does about what it sounds like, but quicker. Useful for checking to see
what kdesrc-build is resolving module dependencies to. The beginning
output is intermixed but you can grep for "* Module list" if you want
and everything after will be module names.
wilder
Michael Pyne 12 years ago
parent b2c8d6dd21
commit 6c49f52422
  1. 30
      doc/index.docbook
  2. 33
      doc/man-kdesrc-build.1.docbook
  3. 8
      modules/ksb/Application.pm

@ -2993,6 +2993,36 @@ also <xref linkend="kdesrc-buildrc" />.
</para></listitem>
</varlistentry>
<varlistentry id="cmdline-print-modules">
<term><parameter>--print-modules</parameter></term>
<listitem>
<para>
Takes all actions up to and including dependency reordering of the modules
specified on the command line (or configuration file), prints the modules
that would be processed one per line, and then exits without further action.
</para>
<para>
The <literal>kde-project</literal> metadata is downloaded first (though, see
<link linkend="cmdline-pretend"><option>--pretend</option></link> or <link
linkend="cmdline-no-src"><option>--no-src</option></link>).
</para>
<para>
The output is not fully compatible with usage by scripts as other output messages
may be generated until the module list is shown.
</para>
<para>
This is mostly just useful for quickly determining what &kdesrc-build;
understands a module's dependencies to be, which means it's only useful for
<link
linkend="kde-projects-module-sets"><literal>kde-projects</literal></link>
modules. This option is also compatible with <link
linkend="cmdline-resume-from"><option>--resume-from</option></link>, <link
linkend="cmdline-resume-after"><option>--resume-after</option></link>,
<link linkend="cmdline-stop-before"><option>--stop-before</option></link>,
<link linkend="cmdline-stop-after"><option>--stop-after</option></link>.
</para></listitem>
</varlistentry>
<varlistentry id="cmdline-run">
<term><parameter>--run</parameter></term>
<listitem><para>

@ -446,6 +446,39 @@ combining short options into one at this point. (E.g. running
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--print-modules</option>
</term>
<listitem>
<para>
Takes all actions up to and including dependency reordering of the modules
specified on the command line (or configuration file), prints the modules
that would be processed one per line, and then exits without further action.
</para>
<para>
The <literal>kde-project</literal> metadata is downloaded first (though, see
<option>--pretend</option> or <option>--no-src</option>).
</para>
<para>
The output is not fully compatible with usage by scripts as other output messages
may be generated until the module list is shown.
</para>
<para>
This is mostly just useful for quickly determining what
<command>kdesrc-build</command> understands a module's dependencies to be,
which means it's only useful for <literal>kde-projects</literal> modules.
This option is also compatible with <option>--resume-from</option>,
<option>--resume-after</option>, <option>--stop-before</option>, and
<option>--stop-after</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--color</option>

@ -260,7 +260,7 @@ DONE
'reconfigure', 'colorful-output|color!', 'async!',
'src-only|svn-only', 'build-only', 'build-system-only',
'rc-file=s', 'prefix=s', 'niceness|nice:10', 'ignore-modules=s{,}',
'pretend|dry-run|p', 'refresh-build',
'print-modules', 'pretend|dry-run|p', 'refresh-build',
'start-program|run=s{,}',
'revision=i', 'resume-from=s', 'resume-after=s',
'stop-after=s', 'stop-before=s', 'set-module-option-value=s',
@ -713,6 +713,12 @@ sub runAllModulePhases
# _resolveSelectorsIntoModules) in that event.
@modules = _applyModuleFilters($ctx, @modules);
if ($ctx->getOption('print-modules')) {
info (" * Module list", $metadataModule ? " in dependency order" : '');
say "$_" foreach @modules;
return 0; # Abort execution early!
}
# Add to global module list now that we've filtered everything.
$ctx->addModule($_) foreach @modules;

Loading…
Cancel
Save