[kde-doc-english] [kdesrc-build/fix-recursing] /: kde-projects: Don't auto-filter git-repo's direct children.

Michael Pyne mpyne at kde.org
Fri Jul 12 03:44:23 UTC 2013


Git commit a033866429b62c29fd93aea843c2f21427634ec8 by Michael Pyne.
Committed on 06/07/2013 at 04:50.
Pushed by mpyne into branch 'fix-recursing'.

kde-projects: Don't auto-filter git-repo's direct children.

Kind of a mouthful, but remove a filter that was added to avoid
automatically including an actual git repository's children that were
also git repositories. E.g. think of something like a SuperBuild git
module that also had its component git modules as logical children
within projects.kde.org.

This filter is unnecessary now that kdesrc-build supports both kde.org
metadata (kde-build-metadata/build-script-ignore) and user-configurable
module filtering (ignore-modules option).

More importantly this filter precludes many other desirable types of
group syntax (e.g. including all of kdebindings just by asking for
kdebindings).

So we remove the filter. The trouble I've seen so far is that it is
now rather difficult to build *only* kdelibs, since kde/kdelibs is a
logical parent of nepomuk-core, nepomuk-widgets, and kactivities. This
can be worked-around by using a normal single module declaration. E.g.

    module kdelibs
        repository kde:kdelibs
    end module

On the other hand, the recently-added config file option
"ignore-modules" should now remove any kde-projects modules that contain
a path component(s) matching the ignored module. You may have to be
specific with a given ignore atom for this reason (e.g. ignore
playground/libs, not 'libs' otherwise you'll also ignore
kdegraphics/libs at this point... though that was also true before this
commit).

BUG:321667

M  +24   -0    doc/index.docbook
M  +1    -1    modules/ksb/BuildContext.pm
M  +10   -13   modules/ksb/KDEXMLReader.pm

http://commits.kde.org/kdesrc-build/a033866429b62c29fd93aea843c2f21427634ec8

diff --git a/doc/index.docbook b/doc/index.docbook
index 1ae458e..efa0882 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -822,6 +822,18 @@ module-set <replaceable>utils</replaceable>
     # This option "subtracts out" modules from the modules chosen by use-modules, above.
     <option><link linkend="conf-ignore-modules">ignore-modules</link></option> <replaceable>kremotecontrol</replaceable>
 end module-set
+
+module-set <replaceable>graphics</replaceable>
+    <option><link linkend="conf-repository">repository</link></option> <literal>kde-projects</literal>
+
+    # This option chooses what modules to look for in the database.
+    <option><link linkend="conf-use-modules">use-modules</link></option> <replaceable>extragear/graphics</replaceable>
+
+    # This option "subtracts out" modules from the modules chosen by use-modules, above.
+    # In this case, *both* extragear/graphics/kipi-plugins and
+    # extragear/graphics/kipi-plugins/kipi-plugins-docs are ignored
+    <option><link linkend="conf-ignore-modules">ignore-modules</link></option> <replaceable>extragear/graphics/kipi-plugins</replaceable>
+end module-set
 </programlisting>
 </example>
 
@@ -1883,6 +1895,18 @@ instead skipped entirely. Use this option when you want to build an entire
 <link linkend="kde-projects-module-sets">kde-projects</link> project grouping
 <emphasis>except for</emphasis> some specific modules.</para>
 
+<para>The option value does not necessarily have to name the module directly.
+Any module that has full consecutive parts of its <link
+linkend="kde-projects-module-sets">&kde; projects module path</link> match one
+of the option values will be ignored, so you can ignore multiple modules this
+way.</para>
+
+<para>For example, an option value of <replaceable>libs</replaceable> would
+result in both <symbol>kde/kdegraphics/libs</symbol> and
+<symbol>playground/libs</symbol> being excluded (though not
+<symbol>kde/kdelibs</symbol> since the full part <quote>kdelibs</quote> is what
+is compared).</para>
+
 <tip><para>See also <xref linkend="example-ignoring-a-module"/>.</para></tip>
 
 <para>This option was introduced with &kdesrc-build; 1.16.</para>
diff --git a/modules/ksb/BuildContext.pm b/modules/ksb/BuildContext.pm
index d7af14a..a281d2d 100644
--- a/modules/ksb/BuildContext.pm
+++ b/modules/ksb/BuildContext.pm
@@ -170,7 +170,7 @@ sub addModule
     }
     elsif (($path = $module->getOption('#xml-full-path')) &&
         # See if the name matches any given in the ignore list.
-           any(sub { $path =~ /(^|\/)$_$/ }, $self->{ignore_list}))
+           any(sub { $path =~ /(^|\/)$_($|\/)/ }, $self->{ignore_list}))
     {
         debug("Skipping ignored module $module");
     }
diff --git a/modules/ksb/KDEXMLReader.pm b/modules/ksb/KDEXMLReader.pm
index 5db0193..7429ae4 100644
--- a/modules/ksb/KDEXMLReader.pm
+++ b/modules/ksb/KDEXMLReader.pm
@@ -51,7 +51,6 @@ my @modules;               # Result list
 my $curRepository;         # ref to hash table when we are in a repo
 my $trackingReposFlag = 0; # >0 if we should be tracking for repo elements.
 my $inRepo = 0;            # >0 if we are actually in a repo element.
-my $repoFound = 0;         # If we've already found the repo we need.
 my $searchProject = '';    # Project we're looking for.
 my $desiredProtocol = '';  # URL protocol desired (normally 'git')
 
@@ -132,25 +131,23 @@ sub xmlTagStart
                         last;
                     }
                 }
-
-                # Reset our found flag if we're looking for another repo
-                $repoFound = 0 if $trackingReposFlag > 0;
             }
         }
     }
 
-    # Checking that we haven't already found a repo helps us out in
-    # situations where a supermodule has its own repo, -OR- you could build
-    # it in submodules. We won't typically want to do both, so prefer
-    # supermodules this way. (e.g. Calligra and its Krita submodules)
-    if ($element eq 'repo' &&     # Found a repo
-        $trackingReposFlag > 0 && # When we were looking for one
-        ($trackingReposFlag <= $repoFound || $repoFound == 0))
-            # (That isn't a direct child of an existing repo)
+    # This code used to check for direct descendants and filter them out.
+    # Now there are better ways (kde-build-metadata/build-script-ignore and
+    # the user can customize using ignore-modules), and this filter made it
+    # more difficult to handle kde/kdelibs{,/nepomuk-{core,widgets}}, so leave
+    # it out for now. See also bug 321667.
+    if ($element eq 'repo' &&   # Found a repo
+        $trackingReposFlag > 0) # When we were looking for one
     {
+        # This flag is cleared by the <repo>-end handler, so this *should* be
+        # logically impossible.
         die "We are already tracking a repository" if $inRepo > 0;
+
         $inRepo = 1;
-        $repoFound = $trackingReposFlag;
         $curRepository = {
             'fullName' => join('/', @nameStack),
             'repo' => '',


More information about the kde-doc-english mailing list