Browse Source

Fix ports version/dir if name depends on subpackage

Use the show-indexed make target to get the FULLPKGNAME variable
so we get the correct version if the package name depends on
a SUBPACKAGE.
Markus Hennecke 5 years ago
parent
commit
18bb6d1e8b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      autoupdate.pl

+ 3 - 3
autoupdate.pl

@@ -240,7 +240,7 @@ sub get_ports_version {
 	my $port = shift;
 
 	chdir "$port" || return undef;
-	my $cmd = 'make show=FULLPKGNAME';
+	my $cmd = 'make show-indexed=FULLPKGNAME';
 	my $pkgname = '';
 
 	open(my $in, "$cmd 2>&1 |")
@@ -527,12 +527,12 @@ sub find_newer_ports_dir {
 	foreach my $dir (@port_locations) {
 		my $port_dir = "$dir/$port";
 		my $version = get_ports_version($port_dir);
-		push @versions, $version;
+		push @versions, $version if $version;
 	}
 
 	my $highest
 	    = reduce { get_higher_version($a, $b) <= 0 ? $a : $b } @versions;
-	my $idx = 0;
+	my $idx = 1;
 	$idx = grep
 		{ defined($versions[$_])
 		    && ($versions[$_] eq $highest) ? $_ : -1 } 0..$#versions