summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pm/MGATools/rpmsrate.pm20
1 files changed, 8 insertions, 12 deletions
diff --git a/pm/MGATools/rpmsrate.pm b/pm/MGATools/rpmsrate.pm
index f5bb8f0..14bd2ac 100644
--- a/pm/MGATools/rpmsrate.pm
+++ b/pm/MGATools/rpmsrate.pm
@@ -72,23 +72,19 @@ sub preread_rpmsrate {
}
sub lookup_pkg {
- my ($key, $fullpath, $urpm2, $o_urpm) = @_;
+ my ($fullpath, $urpm) = @_;
- # try to lookup package in urpm first (if we got an $urpm and if media were parsed):
- return $o_urpm->{rpm}{$o_urpm->{rpmkey}{key}{$key}} if ref($o_urpm);
-
- # if package is not urpmi' synthesis, try to parse it directly:
- my $id = $urpm2->parse_rpm($fullpath);
- return $urpm2->{depslist}[$id];
+ my $id = $urpm->parse_rpm($fullpath);
+ return $urpm->{depslist}[$id];
}
sub check_if_expandable {
- my ($key, $raw, $fullpath, $potloc, $locale, $localized_pkg, $urpm2, $o_urpm) = @_;
+ my ($key, $raw, $fullpath, $potloc, $locale, $localized_pkg, $urpm) = @_;
my ($pg, $loc) = $raw =~ /^(.*)-([^-+]+)$/;
return if !$pg || !$loc;
return if !$potloc->{$pg};
- my $pkg = lookup_pkg($key, $fullpath, $urpm2, $o_urpm);
+ my $pkg = lookup_pkg($fullpath, $urpm);
# still nothing? bailout:
if (!$pkg) {
@@ -106,7 +102,7 @@ sub check_if_expandable {
# function copied from Mkcd::Tools
sub cleanrpmsrate {
- my ($rpmsrate_file, $output, $reprpms, $o_urpm) = @_;
+ my ($rpmsrate_file, $output, $reprpms) = @_;
my ($rpmsrate, $potloc) = preread_rpmsrate($rpmsrate_file);
@@ -116,7 +112,7 @@ sub cleanrpmsrate {
my $kernel_like = "((?:(?:NVIDIA_)?kernel|NVIDIA_nforce|cm2020).*)";
my $dkms_like = '(.*)([-_])kernel-([0-9]+(?:\.[0-9]+){2,3}-\w+-[0-9]+(?:.[^.]+){0,2}\.?mga\d+)(.*)';
my $rpmsrate_dkms_like = "(.*[-_]kernel)(.*)";
- my $urpm2 = URPM->new;
+ my $urpm = URPM->new;
foreach my $dir (keys %$reprpms) {
foreach (@{$reprpms->{$dir}}) {
@@ -139,7 +135,7 @@ sub cleanrpmsrate {
$rpms{$vname} = [ $3, $vname ];
}
} else {
- check_if_expandable($key, $_, "$dir/$rpm", $potloc, \%locale, \%localized_pkg, $urpm2, $o_urpm);
+ check_if_expandable($key, $_, "$dir/$rpm", $potloc, \%locale, \%localized_pkg, $urpm);
}
}
}