From cf926b46efcea35ea3c0427221c3b60dfc09ce3a Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 16 Dec 2017 21:00:56 -0500 Subject: [PATCH] kde-projects: Track how a module became a selection candidate. This is needed to try to perform filtering of the module list based on which git branches are available, which we could do easily when using kde_projects.xml. Without that data, we effectively have to wait until the module list is already made and about to git update a module before we can tell if the branch will be there. By that time it's too late to have filtered the module list, so we have to determine whether this should be a hard error or not later in execution. To make that choice, we essentially need to know whether the module is being built because it was specifically asked for or whether it was brought in as part of a larger module set (and therefore can be ignored if the git branch is missing). This adds tracing for the config file to supplement existing tracing of cmdline selectors. --- modules/ksb/KDEXMLReader.pm | 22 ++++++++++------------ modules/ksb/ModuleSet/KDEProjects.pm | 6 ++---- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/modules/ksb/KDEXMLReader.pm b/modules/ksb/KDEXMLReader.pm index 9a26b94..e7493f6 100644 --- a/modules/ksb/KDEXMLReader.pm +++ b/modules/ksb/KDEXMLReader.pm @@ -99,16 +99,8 @@ sub _readYAML 'repo' => $repoPath, 'name' => $repoName, 'active' => !!$proj_data->{repoactive}, - # Hardcoded from common/urls_gitrepo.json - # 'tarball' => "https://anongit.kde.org/$repoName/$repoName-latest.tar.gz", - 'tarball' => '', - - # Branch data was entered into XML by reading git repo directly, so we must - # wait for git repo to be loaded or use dependency data/logical module groups - # 'branch' => '', - # 'branches' => [ ], - # 'branchtype' => '', # Either branch:stable or branch:trunk - }; # Repo/Active/tarball to be added by char handler. + 'found_by' => 'direct', # can be changed in getModulesForProject + }; $self->{repositories}->{$repoName} = $curRepository; } @@ -124,11 +116,17 @@ sub getModulesForProject my $repositoryRef = $self->{repositories}; my @results; my $findResults = sub { - push @results, ( + my @matchList = grep { _projectPathMatchesWildcardSearch( $repositoryRef->{$_}->{'fullName'}, $proj) - } (keys %{$repositoryRef})); + } (keys %{$repositoryRef}); + + if ($proj =~ m/\*/) { + $repositoryRef->{$_}->{found_by} = 'wildcard' foreach @matchList; + } + + push @results, @matchList; }; # Wildcard matches happen as specified if asked for. diff --git a/modules/ksb/ModuleSet/KDEProjects.pm b/modules/ksb/ModuleSet/KDEProjects.pm index 1add6c4..5e3ddc3 100644 --- a/modules/ksb/ModuleSet/KDEProjects.pm +++ b/modules/ksb/ModuleSet/KDEProjects.pm @@ -176,12 +176,10 @@ sub _expandModuleCandidates $self->_initializeNewModule($newModule); $newModule->setOption('repository', $repo); $newModule->setOption('#xml-full-path', $result->{'fullName'}); - $newModule->setOption('#branch:stable', $result->{'branch:stable'}); + $newModule->setOption('#branch:stable', undef); + $newModule->setOption('#found-by', $result->{found_by}); $newModule->setScmType('proj'); - my $tarball = $result->{'tarball'}; - $newModule->setOption('#snapshot-tarball', $tarball) if $tarball; - if (none_true( map { ksb::KDEXMLReader::_projectPathMatchesWildcardSearch(