aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-unpack.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-03-08 18:55:41 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-03-09 14:54:52 +0300
commita9dcee01b4d4d39d18db60092533dc2985d1c2d4 (patch)
treea784424c8cba314d938478d8728c3efe08db6264 /bpkg/pkg-unpack.cxx
parent78229192fc54ec1822bb29146f08386e3c60f813 (diff)
Prefer dir repository type over others for pkg-build
Diffstat (limited to 'bpkg/pkg-unpack.cxx')
-rw-r--r--bpkg/pkg-unpack.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/bpkg/pkg-unpack.cxx b/bpkg/pkg-unpack.cxx
index aa3390d..9bd3e03 100644
--- a/bpkg/pkg-unpack.cxx
+++ b/bpkg/pkg-unpack.cxx
@@ -192,21 +192,17 @@ namespace bpkg
if (ap == nullptr)
fail << "package " << n << " " << v << " is not available";
- // Pick a directory-based repository. Preferring a local one over the
- // remotes seems like a sensible thing to do.
+ // Pick a directory-based repository. They are always local, so we pick
+ // the first one.
//
const package_location* pl (nullptr);
for (const package_location& l: ap->locations)
{
- const repository_location& rl (l.repository.load ()->location);
-
- if (rl.directory_based () && (pl == nullptr || rl.local ()))
+ if (l.repository.load ()->location.directory_based ())
{
pl = &l;
-
- if (rl.local ())
- break;
+ break;
}
}