From ae03b3779954bf60f755349285c631a11b4b6564 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 10 Dec 2014 16:07:40 +0100 Subject: [PATCH] speed up susetags parsing a tiny bit --- Build/Susetags.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Build/Susetags.pm b/Build/Susetags.pm index 7dfd567e1..197cc278a 100644 --- a/Build/Susetags.pm +++ b/Build/Susetags.pm @@ -58,6 +58,13 @@ my %tmap = ( sub addpkg { my ($res, $data, $options) = @_; + # fixup location and source + if (exists($data->{'location'})) { + my ($medium, $dir, $loc) = split(' ', $data->{'location'}, 3); + $data->{'medium'} = $medium; + $data->{'location'} = defined($loc) ? "$dir/$loc" : "$data->{'arch'}/$dir"; + } + $data->{'source'} =~ s/\s.*// if exists $data->{'source'}; if ($options->{'addselfprovides'} && defined($data->{'name'}) && defined($data->{'version'})) { if (($data->{'arch'} || '') ne 'src' && ($data->{'arch'} || '') ne 'nosrc') { my $evr = $data->{'version'}; @@ -108,12 +115,7 @@ sub parse { ($cur->{'name'}, $cur->{'version'}, $cur->{'release'}, $cur->{'arch'}) = split(' ', $data); $cur->{'epoch'} = $1 if $cur->{'version'} =~ s/^(\d+)://; next; - } elsif ($tag eq 'Loc') { - my ($medium, $dir, $loc) = split(' ', $data, 3); - $cur->{'medium'} = $medium; - $cur->{'location'} = defined($loc) ? "$dir/$loc" : "$cur->{'arch'}/$dir"; } else { - $data =~ s/\s.*// if $tag eq 'Src'; $cur->{$tmap{$tag}} = $data; } }