kde-projects: DRY refactor effective branch-group.

wilder
Michael Pyne 12 years ago
parent 60c9f9129b
commit 7fe0f3f13d
  1. 9
      modules/ksb/Application.pm
  2. 19
      modules/ksb/BuildContext.pm

@ -682,14 +682,7 @@ sub _resolveModuleDependencies
@modules = eval {
my $dependencyResolver = ksb::DependencyResolver->new();
my $branchGroup = $ctx->getOption('branch-group', 'module') // '';
if (!$branchGroup) {
$branchGroup = $ctx->getOption('use-stable-kde')
? 'latest-qt4'
: ($ctx->hasOption('use-stable-kde') # Could also be false if unset
? 'kf5-qt5' # Really set to false
: 'latest-qt4'); # Unset / this is default branch group if no option set
}
my $branchGroup = $ctx->effectiveBranchGroup();
for my $file ('dependency-data-common', "dependency-data-$branchGroup")
{

@ -951,6 +951,25 @@ sub setKDEProjectMetadataModuleNeeded
return;
}
# Returns the effective branch group to use for modules. You should not call
# this unless kde-build-metadata is also in use (see
# setKDEProjectMetadataModule and moduleBranchGroupResolver).
sub effectiveBranchGroup
{
my $self = shift;
my $branchGroup = $self->getOption('branch-group', 'module') // '';
if (!$branchGroup) {
$branchGroup = $self->getOption('use-stable-kde')
? 'latest-qt4'
: ($self->hasOption('use-stable-kde') # Could also be false if unset
? 'kf5-qt5' # Really set to false
: 'latest-qt4'); # Unset / this is default branch group if no option set
}
return $branchGroup;
}
# Returns a ksb::Module::BranchGroupResolver which can be used to efficiently
# determine a git branch to use for a given kde-projects module (when the
# branch-group option is in use), as specified at

Loading…
Cancel
Save