From 66b2428ee54f1ec978190bdbd89425efcc230d57 Mon Sep 17 00:00:00 2001 From: John McQuah Date: Fri, 29 Jul 2022 14:52:57 -0400 Subject: [PATCH] prt-auf: also consider release (not just version) when looking for differences --- scripts/prt-auf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/prt-auf b/scripts/prt-auf index ef3ea99..0fdcede 100755 --- a/scripts/prt-auf +++ b/scripts/prt-auf @@ -41,7 +41,7 @@ if ($osearch{cache}==1) { fill_hashes_from_cache(); } if ($action !~ /^(quickdep|search|dsearch|fsearch|info|dup|readme|cat)$/) { open (DB, $pkgdb) or die "Could not open package database!\n"; local $/=""; - while () { $V_INST{$1} = $2 if m/^(.*)\n(.*)-[0-9]+\n/; } + while () { $V_INST{$1} = $2 if m/^(.*)\n(.*)\n/; } close (DB); } @@ -98,11 +98,12 @@ if (($action =~ /^(listinst|listorphans)/) printf $strf, $result; } } elsif ($action =~ /^(fsearch)/) { - my %hits = %{$hh}; $strf = "%20s %s\n"; + my %hits = %{$hh}; $strf = "%20s %s\n"; my @fmatch; printf $strf, "Found in", "Matching File"; foreach my $fh (keys %hits) { chomp($hits{$fh}); - printf $strf, $fh, (split /\s/, $hits{$fh})[2]; + @fmatch = split /\s/, $hits{$fh}; + foreach my $fileN (@fmatch) { printf $strf, $fh, $fileN; } } } elsif ($action =~ /^(diff|quickdiff|current|isinst|dup)$/) { exit $ind; @@ -349,8 +350,8 @@ sub fill_hashes_from_cache { while (1) { $p = <$cf>; last unless defined $p; chomp($p); - $ignored = <$cf>; $V_REPO{$p} = <$cf>; - $ignored = <$cf>; $DESC{$p} = <$cf>; + $ignored = <$cf>; $V_REPO{$p} = <$cf>; chomp($V_REPO{$p}); + $V_REPO{$p} .= <$cf>; $DESC{$p} = <$cf>; $deps = <$cf>; chomp($deps, $DESC{$p}, $V_REPO{$p}); $DEPENDS{$p} = ($deps ne "") ? $deps : " "; @@ -366,6 +367,7 @@ sub fill_hashes_from_pkgfiles { my ($rver, $rrel, $rdesc, $rdeps) = get_pkgfile_fields($pp); $V_REPO{$p} = ($rver) ? $rver : "0"; + $V_REPO{$p} .= ($rrel) ? "-$rrel" : "-1"; $DEPENDS{$p} = ($rdeps) ? $rdeps : ""; $DEPENDS{$p} =~ s/, / /g; $DEPENDS{$p} =~ s/,/ /g; $DESC{$p} = ($rdesc) ? $rdesc : ""; @@ -409,8 +411,7 @@ sub find_port_by_file { # for now only used to search footprints, but can be gen LOCALENTRY: foreach $lp (@localports) { open ($fh, "$lp/$portfile") or die "cannot open $portfile for $lp\n"; while (<$fh>) { - next LOCALENTRY if $hits{$lp}; - $hits{$lp} = $_ if $_ =~ $linewanted; + $hits{$lp} .= (split /\s/, $_)[2]." " if $_ =~ $linewanted; } close ($fh); } foreach my $collection (@basedirs) { @@ -420,8 +421,7 @@ sub find_port_by_file { # for now only used to search footprints, but can be gen next if (! -f "$collection/$candidate/$portfile"); open ($fh, "$collection/$candidate/$portfile") or die "cannot open $portfile in $candidate\n"; while (<$fh>) { - next PORTENTRY if $hits{"$prefix$candidate"}; - $hits{"$prefix$candidate"}=$_ if $_ =~ $linewanted; + $hits{"$prefix$candidate"} .= (split /\s/, $_)[2]." " if $_ =~ $linewanted; } close ($fh); } closedir(DIR); }