[kde-doc-english] [kdesrc-build] /: Add a --print-modules command line option.

Michael Pyne mpyne at kde.org
Thu Feb 6 05:31:08 UTC 2014


Git commit 6c49f52422fcc4c09960b8aaa36375d652c6c531 by Michael Pyne.
Committed on 06/02/2014 at 05:20.
Pushed by mpyne into branch 'master'.

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.

M  +30   -0    doc/index.docbook
M  +33   -0    doc/man-kdesrc-build.1.docbook
M  +7    -1    modules/ksb/Application.pm

http://commits.kde.org/kdesrc-build/6c49f52422fcc4c09960b8aaa36375d652c6c531

diff --git a/doc/index.docbook b/doc/index.docbook
index 8dd72ed..ad8a512 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -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>
diff --git a/doc/man-kdesrc-build.1.docbook b/doc/man-kdesrc-build.1.docbook
index 4bb52c9..f58b619 100644
--- a/doc/man-kdesrc-build.1.docbook
+++ b/doc/man-kdesrc-build.1.docbook
@@ -448,6 +448,39 @@ combining short options into one at this point. (E.g. running
 
 <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>
 </term>
 
diff --git a/modules/ksb/Application.pm b/modules/ksb/Application.pm
index d104802..85be2d7 100644
--- a/modules/ksb/Application.pm
+++ b/modules/ksb/Application.pm
@@ -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;
 



More information about the kde-doc-english mailing list