瀏覽代碼

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 年之前
父節點
當前提交
18bb6d1e8b
共有 1 個文件被更改,包括 3 次插入3 次删除
  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