[kde-doc-english] [kdesrc-build] /: Allow 'options' groups to apply to named module-sets.
Michael Pyne
mpyne at kde.org
Sun Jul 24 17:03:41 UTC 2016
Git commit c3081844077eb53adb8a9d58c8a3e3dc66921cee by Michael Pyne.
Committed on 24/07/2016 at 17:01.
Pushed by mpyne into branch 'master'.
Allow 'options' groups to apply to named module-sets.
This makes it more convenient to work with baseline configurations (that
are 'include'd) without changing the upstream configuration.
Still to do: add a warning when modules and module-sets end up sharing
the same name somehow.
BUG:365813
FIXED-IN:16.08
M +9 -1 doc/index.docbook
M +5 -1 modules/ksb/ModuleResolver.pm
http://commits.kde.org/kdesrc-build/c3081844077eb53adb8a9d58c8a3e3dc66921cee
diff --git a/doc/index.docbook b/doc/index.docbook
index 301a1e7..0e6a5b9 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -112,7 +112,7 @@
<legalnotice>&FDLNotice;</legalnotice>
<date>2016-05-02</date>
-<releaseinfo>&kdesrc-build; 16.05</releaseinfo>
+<releaseinfo>&kdesrc-build; 16.08</releaseinfo>
<abstract>
<para>&kdesrc-build; is a script which builds and installs &kde; software
@@ -1450,6 +1450,14 @@ mis-typing the name.</para></important>
<literal>module-set</literal> worth of modules, all using the same options, and
then using <literal>options</literal> groups to make individual changes.</para>
+<para><literal>options</literal> groups can also apply to named module sets.
+This allows expert users to use a common configuration file (which includes
+<literal>module-set</literal> declarations) as a baseline, and then make changes
+to the options used by those module-sets in configuration files that
+use the <literal><link
+linkend="kdesrc-buildrc-including">include</link></literal> command to reference
+the base configuration.</para>
+
<example id="ex-options-group">
<title>Example of using options</title>
diff --git a/modules/ksb/ModuleResolver.pm b/modules/ksb/ModuleResolver.pm
index 6696a48..0cfd3c6 100644
--- a/modules/ksb/ModuleResolver.pm
+++ b/modules/ksb/ModuleResolver.pm
@@ -75,11 +75,15 @@ sub _applyCmdlineOptions
foreach my $m (@modules) {
my $name = $m->name();
+ my $moduleSetName = $m->moduleSet()->name();
# Remove any options that would interfere with cmdline args
delete @{$m->{options}}{@cmdlineArgs};
- # Reapply module-specific cmdline args
+ # Reapply module-specific cmdline args (module-set first)
+ if ($moduleSetName && exists $self->{pendingOptions}->{$moduleSetName}) {
+ $m->setOption(%{$self->{pendingOptions}->{$moduleSetName}});
+ }
$m->setOption(%{$self->{pendingOptions}->{$name}});
}
More information about the kde-doc-english
mailing list