From 730ab19a6a6b618971d82c66795e47e87d9ee613 Mon Sep 17 00:00:00 2001 From: John McQuah Date: Sun, 12 Jun 2022 20:57:11 -0400 Subject: [PATCH] prt-auf: fixed the off-by-one errors in the printf subroutine --- scripts/prt-auf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/prt-auf b/scripts/prt-auf index cf5b9a4..675c61d 100755 --- a/scripts/prt-auf +++ b/scripts/prt-auf @@ -315,6 +315,7 @@ sub printf_ports { $p = (split /\//, $pp)[-1]; @pstats = (get_pkgfile_fields($pp,"all")); printf CACHE "%s\n"x($#pstats+1), @pstats; + printf CACHE "\n"; } close (CACHE); print "cache created.\n"; } else { @@ -324,12 +325,11 @@ sub printf_ports { $outputf = "$inputf\n"; $outputf =~ s/(%p|%n|%v|%r|%d|%e|%u|%P|%M|%R|%E|%O|%l|%i)/%-14s/g; - foreach my $pp (@targets) { $p = (split /\//, $pp)[-1]; @pstats = get_pkgfile_fields($pp,"all"); - $pstats[11] = grep /^$p$/, keys %V_INST; - $pstats[12] = grep /^$p$/, @LOCKED; + $pstats[12] = (grep /^$p$/, keys %V_INST) ? "yes" : "no"; + $pstats[13] = (grep /^$p$/, @LOCKED) ? "yes" : "no"; printf STDOUT $outputf, @pstats[@pos]; } } @@ -375,7 +375,7 @@ sub get_pkgfile_fields { $readme = "yes" if (-f "$portpath/README") or (-f "$portpath/README.md"); $preInstall = "yes" if (-f "$portpath/pre-install"); $postInstall = "yes" if (-f "$portpath/post-install"); - $portpath =~ s/\/[^\/]+?$//; # now it should be called repository path + $portpath =~ s/\/[^\/]+?$//; # now it should be called repository path! open(PF,$pkgfile) or die "Cannot open $pkgfile for reading!\n"; while () {