From e1098f09dee9befb82d760c740ff7f7e4429f837 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sun, 27 Feb 2011 19:25:56 -0500 Subject: [PATCH] Allow cloning XML-based modules from command line. kdesrc-build prefers module names fed in from the command line (obviously ;), but if the module didn't already exist on disk then the only source of info about the module is probably encoded in the rc file, but the modules read from the rc file were ignored. This change simply copies over the more accurate rc-file-based modules that have matching names, without this change you'd get modules that tried to git-clone themselves from "kde-projects" instead of git://anongit.kde.org/foo.git since the pass the alters repository settings only runs on modules that are supposed to be based off of projects.kde.org. --- kdesrc-build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kdesrc-build b/kdesrc-build index eb37238..510aac7 100755 --- a/kdesrc-build +++ b/kdesrc-build @@ -3702,8 +3702,12 @@ sub expandXMLModules { my @modules = @_; + debug "Expanding XML modules in " . join(', ', map { $_->{name} } @modules); + # Using a sub allows me to use the 'return' keyword. my $filter = sub { + debug "$_->{name} is not XML-based" unless $_->{type} eq 'proj'; + return $_ if $_->{'type'} ne 'proj'; ensure_projects_xml_present() or @@ -3716,6 +3720,8 @@ sub expandXMLModules # Setup module options foreach my $xml (@xmlResults) { + debug "Module $name from module-set has XML module $xml->{name}"; + debug "\twith repository b[$xml->{repo}]"; clone_options($name, $xml->{'name'}); set_option($xml->{'name'}, 'repository', $xml->{'repo'}); } @@ -7746,6 +7752,13 @@ eval # Allow named module-sets to be given on the command line. if ($commandLineModules) { + # Copy Module objects from the ones created by read_options + # since their module-type will actually be set. + foreach my $module (@modules) { + my ($optionModule) = grep {$_->{name} eq $module->{name}} @optionModules; + $module = $optionModule if defined $optionModule; + } + # Filter --resume-foo first so entire module-sets can be skipped. @modules = applyModuleFilters(@modules); @modules = expandModuleSets(\@modules, \@optionModules);