Skip to content

Commit 65e970b

Browse files
author
Nick Logan
committed
Fix auto-update
For once the cache isn't to blame - auto-update just wasn't being triggered due to user error in a conditional statement
1 parent 943aabf commit 65e970b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Zef/Repository/Ecosystems.pm6

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class Zef::Repository::Ecosystems does Repository {
1717

1818
method !dists {
1919
# Only update once, and only update automatically if $!auto-update is enabled or no package list exists yet
20-
self.update unless $!update-counter++
21-
|| !$!auto-update
22-
|| self!package-list-file.e;
20+
self.update if ($!auto-update && !$!update-counter)
21+
or !self!package-list-file.e;
22+
2323
%dist_cache{self.id} := %dist_cache{self.id}
2424
?? %dist_cache{self.id}
2525
!! cache gather for self!slurp-package-list -> $meta {
@@ -55,6 +55,7 @@ class Zef::Repository::Ecosystems does Repository {
5555
}
5656

5757
method update {
58+
$!update-counter++;
5859
die "Failed to update $!name" unless $!mirrors.first: -> $uri {
5960
my $save-as = $!cache.IO.child($uri.IO.basename);
6061
my $path = try { $!fetcher.fetch($uri, $save-as) } || next;

0 commit comments

Comments
 (0)