Wednesday, May 29, 2019

Re: pkg_outdated: add support for $PORTSDIR_PATH

On Wed, Apr 17, 2019 at 09:11:59AM +0200, Sebastien Marie wrote:
> On Sun, Mar 24, 2019 at 12:10:32PM +0100, Sebastien Marie wrote:
> > Hi,
> >
> > I am using PORTSDIR_PATH for local ports (aka mystuff), and I usually
> > ran pkg_outdated to check if I need to rebuild these packages (due to
> > dependencies).
> >
> > Currently, it isn't possible out-of-box: pkg_outdated checks only for
> > "official" ports. I would like to extend it a bit to check also others
> > ports available thought PORTSDIR_PATH.
> >
> > The following diff does that by avoid checking if the directory
> > "$portsdir/$dir" exists, but rely on make output to determine if the
> > port is accessible for futher investigation.
> >
> > Comments or OK ?
>
> ping
>

reping
--
Sebastien Marie

Index: pkg_outdated
===================================================================
RCS file: /cvs/ports/infrastructure/bin/pkg_outdated,v
retrieving revision 1.5
diff -u -p -r1.5 pkg_outdated
--- pkg_outdated 19 May 2019 08:48:58 -0000 1.5
+++ pkg_outdated 21 May 2019 04:47:52 -0000
@@ -45,11 +45,8 @@ sub collect_installed
$name);
return;
}
-
- my $subdir = $plist->{extrainfo}->{subdir};
- $subdir =~ s/mystuff\///;
- $subdir =~ s/\/usr\/ports\///;

+ my $subdir = $plist->{extrainfo}->{subdir};
$pkg->{$subdir}->{name} = $name;
$pkg->{$subdir}->{stem} = $stem;
$pkg->{$subdir}->{version} = $version;
@@ -80,11 +77,7 @@ sub collect_port_versions
my @subdirs = ();
for my $subdir (keys %$pkg) {
my ($dir) = split(/,/, $subdir);
- if (-d "$portsdir/$dir") {
- push(@subdirs, $subdir);
- } else {
- push(@$notfound, $subdir);
- }
+ push(@subdirs, $subdir);
}

my $cmd = "cd $portsdir && SUBDIR=\"".join(' ', @subdirs)
@@ -106,6 +99,12 @@ sub collect_port_versions
$count++;
$state->progress->show($count, $total);
next;
+ } elsif (/^>>\s+Broken dependency\:\s+(\S+)/) {
+ $subdir = $1;
+ push(@$notfound, $subdir);
+ $count++;
+ $state->progress->show($count, $total);
+ next;
}
next unless $_ or $subdir;
next if defined $error->{$subdir};
@@ -237,8 +236,7 @@ if ($opt_q) {
}

if (@notfound > 0) {
- $state->errsay("\nPorts that can't be found in the official "
- . "ports tree:");
+ $state->errsay("\nPorts that can't be found in the ports tree:");
for (sort @notfound) {
$state->errsay("#1", $_);
}

No comments:

Post a Comment