From aa1e4b954279eba1c14d9b0bfa82f95a37992ed6 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sun, 23 Dec 2012 22:48:16 -0500 Subject: [PATCH] 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 --- kdesrc-build | 9 ++++++++- kdesrc-buildrc-sample | 27 +++++++++------------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/kdesrc-build b/kdesrc-build index bc63f15..3b7980d 100755 --- a/kdesrc-build +++ b/kdesrc-build @@ -760,7 +760,14 @@ EOF my $moduleName = $module; # 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); $newModule->setModuleSet($moduleSetName); diff --git a/kdesrc-buildrc-sample b/kdesrc-buildrc-sample index 3032353..6f31676 100644 --- a/kdesrc-buildrc-sample +++ b/kdesrc-buildrc-sample @@ -262,15 +262,15 @@ end module # kdemultimedia contains JuK, Dragon Player and other KDE multimedia # applications. It does not include amarok, which is in git.kde.org -module-set kdemultimedia +module-set repository kde-projects - use-modules kde/kdemultimedia + use-modules kdemultimedia end module-set # ... Well, they're games. ;) -module-set kdegames +module-set repository kde-projects - use-modules kde/kdegames + use-modules kdegames end module-set # kdesdk is a useful module for software developers. Programmers *need* this @@ -299,9 +299,9 @@ end module-set #end module # kdeaccessibility accessibility tools -#module-set accessibility +#module-set # repository kde-projects -# use-modules kde/kdeaccessibility +# use-modules kdeaccessibility #end module-set # 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 # into many more modules. -module-set kdegraphics +module-set repository kde-projects - # Until kdesrc-build supports dependency handling, you should specify - # 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/* + use-modules kdegraphics end module-set # Contains nifty diversions of time, which generally aren't games. @@ -349,10 +343,7 @@ end module module-set kdeedu repository kde-projects - # Until kdesrc-build supports dependency handling, you should specify - # 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 + use-modules kdeedu end module-set # Extra collection of useful plasma applets, runners, data engines, etc.