CC: | tim_hoke [...] symantec.com |
Subject: | non-fallback repository should on the front of the queue |
Suppose we use a repository as follows:
require PAR;
PAR->import( { repository => $url1,
fallback => 0, # check repository first
} );
Then, we use another repository:
PAR->import( { repository => $url2,
fallback => 0, # check repository first
} );
Later, we require Foo, and both repositories contain a Foo module. Which repository's Foo
should be loaded? Today PAR::import gives priority to $url1, but I claim it should be $url2.
Does anyone disagree?
The patch is attached.
Thanks!
Ken
Subject: | PriorityRepositoryObjects.diff |
--- lib/PAR.pm.orig 2012-10-12 10:40:55.000000000 -0500
+++ lib/PAR.pm 2012-10-12 10:41:10.000000000 -0500
@@ -550,7 +550,7 @@
}
if (exists($opt->{fallback}) and not $opt->{fallback}) {
- push @PriorityRepositoryObjects, $obj; # repository beats local stuff
+ unshift @PriorityRepositoryObjects, $obj; # repository beats local stuff
} else {
push @RepositoryObjects, $obj; # local stuff beats repository
}