kde-projects: Normalize module names when parsed.

Although a module like kde/kdeutils/kcalc will eventually end up with a
$module->name() of "kcalc", the module starts off with whatever the user
typed in for its name in the use-modules declaration.

This makes it difficult to override its options in a later module / end
module declaration (as its documented to do). E.g. the kcalc branch for
the following should be "KDE/4.9".

module-set
    repository kde-projects
    use-modules kde/kdeutils/kcalc
    branch KDE/4.10
end module-set

module kcalc
    branch KDE/4.9
end module

*** Important ***: There's no way for kdesrc-build to know when parsing
that the "module foo" is supposed to override a module-set module if it
hasn't seen the foo declared yet. In this example, if you simply did
"use-modules kdeutils" then you may end up with a svn-based kcalc (since
it's a "new" module without a repository declaration).

I'm not sure right now if I'll decide that possibility needs to be
handled as well so I'll leave the bug open. But it should be possible to
override any module-set module that is named with this fix.

CCBUG:299415
wilder
Michael Pyne 13 years ago
parent 8bf685e411
commit aa1e4b9542
  1. 9
      kdesrc-build
  2. 27
      kdesrc-buildrc-sample

@ -760,7 +760,14 @@ EOF
my $moduleName = $module; my $moduleName = $module;
# Remove trailing .git for module name # Remove trailing .git for module name
$moduleName =~ s/\.git$// unless $usingXML; if ($usingXML) {
# Remove all name components before the final /, as long as the /
# isn't followed by a *.
$moduleName =~ s,^.*/(?!\*),,;
}
else {
$moduleName =~ s/\.git$//;
}
my $newModule = ksb::Module->new($ctx, $moduleName); my $newModule = ksb::Module->new($ctx, $moduleName);
$newModule->setModuleSet($moduleSetName); $newModule->setModuleSet($moduleSetName);

@ -262,15 +262,15 @@ end module
# kdemultimedia contains JuK, Dragon Player and other KDE multimedia # kdemultimedia contains JuK, Dragon Player and other KDE multimedia
# applications. It does not include amarok, which is in git.kde.org # applications. It does not include amarok, which is in git.kde.org
module-set kdemultimedia module-set
repository kde-projects repository kde-projects
use-modules kde/kdemultimedia use-modules kdemultimedia
end module-set end module-set
# ... Well, they're games. ;) # ... Well, they're games. ;)
module-set kdegames module-set
repository kde-projects repository kde-projects
use-modules kde/kdegames use-modules kdegames
end module-set end module-set
# kdesdk is a useful module for software developers. Programmers *need* this # kdesdk is a useful module for software developers. Programmers *need* this
@ -299,9 +299,9 @@ end module-set
#end module #end module
# kdeaccessibility accessibility tools # kdeaccessibility accessibility tools
#module-set accessibility #module-set
# repository kde-projects # repository kde-projects
# use-modules kde/kdeaccessibility # use-modules kdeaccessibility
#end module-set #end module-set
# kdeartwork has themes and screensaver # kdeartwork has themes and screensaver
@ -322,16 +322,10 @@ end module-set
# #
# Note that this just references the KDE Projects database, so this will expand # Note that this just references the KDE Projects database, so this will expand
# into many more modules. # into many more modules.
module-set kdegraphics module-set
repository kde-projects repository kde-projects
# Until kdesrc-build supports dependency handling, you should specify use-modules kdegraphics
# submodules that should be built in order specifically, and then the
# parent module, which will build any remaining submodules.
# kde/kdegraphics/* is a special syntax to include all children of
# kde/kdegraphics, but not kde/kdegraphics itself (only one or the other
# should be built)
use-modules kde/kdegraphics/libs kde/kdegraphics/*
end module-set end module-set
# Contains nifty diversions of time, which generally aren't games. # Contains nifty diversions of time, which generally aren't games.
@ -349,10 +343,7 @@ end module
module-set kdeedu module-set kdeedu
repository kde-projects repository kde-projects
# Until kdesrc-build supports dependency handling, you should specify use-modules kdeedu
# submodules that should be built in order specifically, and then the
# parent module, which will build any remaining submodules.
use-modules kde/kdeedu/libkdeedu kde/kdeedu
end module-set end module-set
# Extra collection of useful plasma applets, runners, data engines, etc. # Extra collection of useful plasma applets, runners, data engines, etc.

Loading…
Cancel
Save