|
|
|
|
@ -1,12 +1,11 @@ |
|
|
|
|
package ksb::ModuleSet::KDEProjects 0.20; |
|
|
|
|
package ksb::ModuleSet::KDEProjects 0.30; |
|
|
|
|
|
|
|
|
|
# Class: ModuleSet::KDEProjects |
|
|
|
|
# |
|
|
|
|
# This represents a collective grouping of modules that share common options, |
|
|
|
|
# and are obtained via the kde-projects database at |
|
|
|
|
# https://projects.kde.org/kde_projects.xml |
|
|
|
|
# |
|
|
|
|
# See also the parent class ModuleSet, from which most functionality is derived. |
|
|
|
|
# based on the KDE project repositories. Metadata for that repository is |
|
|
|
|
# itself housed in a dedicated KDE.org git repository "sysadmin/repo-metadata", |
|
|
|
|
# which this class uses to imbue ksb::Modules generated by this ModuleSet. |
|
|
|
|
# |
|
|
|
|
# The only changes here are to allow for expanding out module specifications |
|
|
|
|
# (except for ignored modules), by using KDEXMLReader. |
|
|
|
|
@ -16,10 +15,9 @@ package ksb::ModuleSet::KDEProjects 0.20; |
|
|
|
|
use strict; |
|
|
|
|
use warnings; |
|
|
|
|
use 5.014; |
|
|
|
|
use parent qw(ksb::ModuleSet); |
|
|
|
|
no if $] >= 5.018, 'warnings', 'experimental::smartmatch'; |
|
|
|
|
|
|
|
|
|
our @ISA = qw(ksb::ModuleSet); |
|
|
|
|
|
|
|
|
|
use ksb::Module; |
|
|
|
|
use ksb::Debug; |
|
|
|
|
use ksb::KDEXMLReader 0.20; |
|
|
|
|
@ -125,21 +123,20 @@ sub _expandModuleCandidates |
|
|
|
|
my $ctx = assert_isa(shift, 'ksb::BuildContext'); |
|
|
|
|
my $moduleSearchItem = shift; |
|
|
|
|
|
|
|
|
|
my $srcdir = $ctx->getSourceDir(); |
|
|
|
|
|
|
|
|
|
my $xmlReader = $ctx->getProjectDataReader(); |
|
|
|
|
my @allXmlResults = $xmlReader->getModulesForProject($moduleSearchItem); |
|
|
|
|
my @allModuleResults = $ctx-> |
|
|
|
|
getProjectDataReader()-> |
|
|
|
|
getModulesForProject($moduleSearchItem); |
|
|
|
|
|
|
|
|
|
croak_runtime ("Unknown KDE project: $moduleSearchItem") unless @allXmlResults; |
|
|
|
|
croak_runtime ("Unknown KDE project: $moduleSearchItem") unless @allModuleResults; |
|
|
|
|
|
|
|
|
|
# It's possible to match modules which are marked as inactive on |
|
|
|
|
# projects.kde.org, elide those. |
|
|
|
|
my @xmlResults = grep { $_->{'active'} } (@allXmlResults); |
|
|
|
|
my @activeResults = grep { $_->{'active'} } (@allModuleResults); |
|
|
|
|
|
|
|
|
|
if (!@xmlResults) { |
|
|
|
|
warning (" y[b[*] Module y[$moduleSearchItem] is apparently XML-based, but contains no\n" . |
|
|
|
|
if (!@activeResults) { |
|
|
|
|
warning (" y[b[*] Module y[$moduleSearchItem] is apparently a KDE collection, but contains no\n" . |
|
|
|
|
"active modules to build!"); |
|
|
|
|
my $count = scalar @allXmlResults; |
|
|
|
|
my $count = scalar @allModuleResults; |
|
|
|
|
if ($count > 0) { |
|
|
|
|
warning ("\tAlthough no active modules are available, there were\n" . |
|
|
|
|
"\t$count inactive modules. Perhaps the git modules are not ready?"); |
|
|
|
|
@ -150,7 +147,7 @@ sub _expandModuleCandidates |
|
|
|
|
my @moduleList; |
|
|
|
|
my @ignoreList = $self->modulesToIgnore(); |
|
|
|
|
|
|
|
|
|
foreach (@xmlResults) { |
|
|
|
|
foreach (@activeResults) { |
|
|
|
|
my $result = $_; |
|
|
|
|
my $repo = $result->{'repo'}; |
|
|
|
|
|
|
|
|
|
@ -196,13 +193,13 @@ sub convertToModules |
|
|
|
|
my %foundModules; |
|
|
|
|
|
|
|
|
|
# Setup default options for each module |
|
|
|
|
# Extraction of relevant XML modules will be handled immediately after |
|
|
|
|
# this phase of execution. |
|
|
|
|
# Extraction of relevant kde-project modules will be handled immediately |
|
|
|
|
# after this phase of execution. |
|
|
|
|
for my $moduleItem ($self->modulesToFind()) { |
|
|
|
|
# We might have already grabbed the right module recursively. |
|
|
|
|
next if exists $foundModules{$moduleItem}; |
|
|
|
|
|
|
|
|
|
# eval in case the XML processor throws an exception. |
|
|
|
|
# eval in case the YAML processor throws an exception. |
|
|
|
|
undef $@; |
|
|
|
|
my @candidateModules = eval { |
|
|
|
|
$self->_expandModuleCandidates($ctx, $moduleItem); |
|
|
|
|
@ -210,7 +207,7 @@ sub convertToModules |
|
|
|
|
|
|
|
|
|
if ($@) { |
|
|
|
|
die $@ if had_an_exception(); # Forward exception objects up |
|
|
|
|
croak_runtime("The XML for the KDE Project database could not be understood: $@"); |
|
|
|
|
croak_runtime("The KDE Project database could not be understood: $@"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
my @moduleNames = map { $_->name() } @candidateModules; |
|
|
|
|
|