[sdk/kdesrc-build/docbook_historied_per_file] doc/kdesrc-buildrc: Fix git-repository-base option

Andrew Shark null at kde.org
Fri May 10 10:16:52 BST 2024


Git commit 31ff822811e6823777de3f7a61e3eba980336ac9 by Andrew Shark.
Committed on 26/01/2024 at 04:17.
Pushed by ashark into branch 'docbook_historied_per_file'.

Fix git-repository-base option

Before this commit, only the last occurrence of this option was applied to the build context.

Now we actually can use it several times in the global section, as it was intended.

- The actual reading of 'git-repository-base' was done when constructing OptionBase from the global section of the config.
- The merging options from the constructed OptionsBase object into the BuildContext was done in setOption of BuildContext, but because it was not properly handled in OptionsBase, only the last value was appeared in BuildContext's handling.
- Now it is handled in the OptionsBase also when merging (we expect that the type of value is a hash then).
- Remove incorrect placement of 'git-repository-base' to the checking of module-set option in the Module, so our BuildContex::setOption can call its parent class Module::setOption, which then can pass this option handling to its parent class OptionsBase::setOption.

Also:
- Move endWord suggestion next to the printed message. The actual endWord does not matter when parsing, so it makes code a bit more readable when understanding how it parses
- Edit comment so it better explains why we remove some options that we read from the config
- Move the config description in docbook to the correct scope

Original commit: 56023880
https://invent.kde.org/sdk/kdesrc-build/-/commit/5602388099291523942b475b51a2f6a2334012af

M  +60   -59   doc/kdesrc-buildrc/conf-options-table.docbook

https://invent.kde.org/sdk/kdesrc-build/-/commit/31ff822811e6823777de3f7a61e3eba980336ac9

diff --git a/doc/kdesrc-buildrc/conf-options-table.docbook b/doc/kdesrc-buildrc/conf-options-table.docbook
index 0573f12d..8722b1ae 100644
--- a/doc/kdesrc-buildrc/conf-options-table.docbook
+++ b/doc/kdesrc-buildrc/conf-options-table.docbook
@@ -108,6 +108,66 @@ protocol is most efficient.</para>
 </entry>
 </row>
 
+<row id="conf-git-repository-base">
+<entry><link linkend="conf-git-repository-base">git-repository-base</link></entry>
+<entry>
+<simplelist type='horiz' columns='2'>
+<member>Type</member><member>String</member>
+<member>Available since</member><member>1.12.1</member>
+</simplelist>
+<para>This option is used to create a short
+name to reference a specific Git repository base URL in later <link
+linkend="module-sets">module set</link> declarations, which is useful for
+quickly declaring many Git modules to build.</para>
+
+<para>You must specify two things (separated by a space): The name to assign
+to the base URL, and the actual base URL itself. For example:</para>
+
+<para>
+<programlisting>
+global
+    # other options
+    # This is the common path to all anonymous Git server modules.
+    git-repository-base <replaceable>kde-git</replaceable> <replaceable>kde:</replaceable>
+end global
+
+# Module declarations
+
+module-set
+    # Now you can use the alias you defined earlier, but <emphasis>only</emphasis> in a module-set.
+    repository <replaceable>kde-git</replaceable>
+    <link linkend="conf-use-modules">use-modules</link> <replaceable>module1.git</replaceable> <replaceable>module2.git</replaceable>
+end module-set
+</programlisting>
+</para>
+
+<para>The module-set's <literal>use-modules</literal> option created two modules
+internally, with &kdesrc-build; behaving as if it had read:</para>
+
+<programlisting>
+module module1
+    repository kde:<replaceable>module1.git</replaceable>
+end module
+
+module module2
+    repository kde:<replaceable>module2.git</replaceable>
+end module
+</programlisting>
+
+<para>The <literal>kde:</literal> &git; repository prefix used above is a
+shortcut which will be setup by &kdesrc-build; automatically. See the TechBase
+<ulink
+url="https://techbase.kde.org/Development/Git/Configuration#URL_Renaming">URL
+Renaming</ulink> article for more information. Note that unlike most other
+options, this option can be specified multiple times in order to create as
+many aliases as necessary.</para>
+
+<tip><para>It is not required to use this option to take advantage of module-set,
+this option exists to make it easy to use the same repository across many
+different module sets.</para></tip>
+</entry>
+</row>
+
 <row id="conf-install-environment-driver">
 <entry><link linkend="conf-install-environment-driver">install-environment-driver</link></entry>
 <entry>
@@ -1267,65 +1327,6 @@ installations. However this only works on build systems that support
 </thead>
 <tbody>
 
-<row id="conf-git-repository-base">
-<entry><link linkend="conf-git-repository-base">git-repository-base</link></entry>
-<entry>
-<simplelist type='horiz' columns='2'>
-<member>Type</member><member>String</member>
-<member>Available since</member><member>1.12.1</member>
-</simplelist>
-<para>This option is used to create a short
-name to reference a specific Git repository base URL in later <link
-linkend="module-sets">module set</link> declarations, which is useful for
-quickly declaring many Git modules to build.</para>
-
-<para>You must specify two things (separated by a space): The name to assign
-to the base URL, and the actual base URL itself. For example:</para>
-
-<para>
-<programlisting>
-global
-    # other options
-    # This is the common path to all anonymous Git server modules.
-    git-repository-base <replaceable>kde-git</replaceable> <replaceable>kde:</replaceable>
-end global
-
-# Module declarations
-
-module-set
-    # Now you can use the alias you defined earlier, but <emphasis>only</emphasis> in a module-set.
-    repository <replaceable>kde-git</replaceable>
-    <link linkend="conf-use-modules">use-modules</link> <replaceable>module1.git</replaceable> <replaceable>module2.git</replaceable>
-end module-set
-</programlisting>
-</para>
-
-<para>The module-set's <literal>use-modules</literal> option created two modules
-internally, with &kdesrc-build; behaving as if it had read:</para>
-
-<programlisting>
-module module1
-    repository kde:<replaceable>module1.git</replaceable>
-end module
-
-module module2
-    repository kde:<replaceable>module2.git</replaceable>
-end module
-</programlisting>
-
-<para>The <literal>kde:</literal> &git; repository prefix used above is a
-shortcut which will be setup by &kdesrc-build; automatically. See the TechBase
-<ulink
-url="https://techbase.kde.org/Development/Git/Configuration#URL_Renaming">URL
-Renaming</ulink> article for more information. Note that unlike most other
-options, this option can be specified multiple times in order to create as
-many aliases as necessary.</para>
-
-<tip><para>It is not required to use this option to take advantage of module-set,
-this option exists to make it easy to use the same repository across many
-different module sets.</para></tip>
-</entry>
-</row>
 
 <row id="conf-ignore-modules">
 <entry><link linkend="conf-ignore-modules">ignore-modules</link></entry>



More information about the kde-doc-english mailing list