kde-projects: Fixup module name normalization.

Commit aa1e4b9542 introduced changes to
how "proj" modules are first parsed (simply keeping the last path
component as entered by the user as the module name).

The unintended side-effect of this is that the user doesn't always have
to enter path ending in an actual repo. E.g. extragear/utils is not a
repo, it would get reduced to "utils", and later KDEXMLReader would
effectively look for all repos matching "*/utils/*".

For more fun, do what I did and try "kdegraphics/libs" => "libs" =>
"*/libs/*"...

Anyways, the fix here is to use the normalized module name as the module
name, but use the full user input for the XML search.

CCBUG:299415
wilder
Michael Pyne 13 years ago
parent 2d4ad8383f
commit 2a48c1abe2
  1. 8
      kdesrc-build

@ -774,6 +774,7 @@ EOF
# this phase of execution.
for my $module (@modules) {
my $moduleName = $module;
my $moduleFullName = $moduleName;
# Remove trailing .git for module name
if ($usingXML) {
@ -788,9 +789,13 @@ EOF
$moduleName =~ s/\.git$//;
}
# The "module full name" is used by KDEXMLReader to disambiguate
# partial names. E.g. "kdegraphics/libs" => "libs", which would be read
# in as *all* "*/libs/*" by KDEXMLReader later.
my $newModule = ksb::Module->new($ctx, $moduleName);
$newModule->setModuleSet($moduleSetName);
$newModule->setScmType($usingXML ? 'proj' : 'git');
$newModule->setOption('#xml-search-path', $moduleFullName) if $usingXML;
push @moduleList, $newModule;
# Dump all options into the existing ksb::Module's options.
@ -868,7 +873,8 @@ sub expandXMLModules
# it in by setting a flag to be used by the higher-level subroutine.
$repositoryMetadataRequired = 1;
my $name = $moduleSet->name();
my $name = $moduleSet->getOption('#xml-search-path') or
croak_internal("Somehow tried to read XML data for non-XML module");
my $srcdir = $ctx->getSourceDir();
my $xmlReader = ksb::KDEXMLReader->new($databaseFile);

Loading…
Cancel
Save