From 10b7c12ad5a935e8254df302821ed639c3a1f926 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 15 Dec 2012 20:07:15 -0500 Subject: [PATCH] kde-projects: Record which branches are available for a module. This is needed to properly fix bug 307694 and can also be useful for dependency data handling/verification. --- modules/ksb/KDEXMLReader.pm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/modules/ksb/KDEXMLReader.pm b/modules/ksb/KDEXMLReader.pm index 5d626c0..6930a4a 100644 --- a/modules/ksb/KDEXMLReader.pm +++ b/modules/ksb/KDEXMLReader.pm @@ -134,7 +134,9 @@ sub xmlTagStart 'name' => $nameStack[-1], 'active' => 'false', 'tarball' => '', - 'branch:stable' => '', + 'branch' => '', + 'branches' => [ ], + 'branchtype' => '', # Either branch:stable or branch:trunk }; # Repo/Active/tarball to be added by char handler. } @@ -160,8 +162,11 @@ sub xmlTagStart $attrs{'protocol'} eq 'tarball' ? 'tarball' : undef; } # i18n data gives us the defined stable and trunk branches. - elsif ($element eq 'branch' && $attrs{'i18n'} && $attrs{'i18n'} eq 'stable') { - $curRepository->{'needs'} = 'branch:stable'; + elsif ($element eq 'branch') { + $curRepository->{'needs'} = 'branch'; + + my $branchType = $attrs{'i18n'} // ''; + $curRepository->{'branchtype'} = "branch:$branchType" if $branchType; } } @@ -178,6 +183,18 @@ sub xmlTagEnd delete $curRepository->{'needs'}; } + # Save all branches encountered, mark which ones are 'stable' and 'trunk' + # for i18n purposes, as this keys into use-stable-kde handling. + if ($element eq 'branch') { + my $branch = $curRepository->{'branch'}; + push @{$curRepository->{'branches'}}, $branch; + $curRepository->{'branch'} = ''; + + my $branchType = $curRepository->{'branchtype'}; + $curRepository->{$branchType} = $branch if $branchType; + $curRepository->{'branchtype'} = ''; + } + if ($element eq 'repo' && $inRepo) { $inRepo = 0; push @modules, $curRepository;