aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-fetch.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-04-27 15:53:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-04-27 15:55:18 +0300
commita2b084651909929d58f6b4bc0f3c742d87ee31f6 (patch)
tree63ef970e6edc44473ca9450dce93cbd130127d57 /bpkg/pkg-fetch.cxx
parentf86216071cd4d8d120a8afb83f4b452ef7892ea1 (diff)
Add support for repository fragments
Diffstat (limited to 'bpkg/pkg-fetch.cxx')
-rw-r--r--bpkg/pkg-fetch.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx
index a5efa47..36aaa21 100644
--- a/bpkg/pkg-fetch.cxx
+++ b/bpkg/pkg-fetch.cxx
@@ -58,7 +58,7 @@ namespace bpkg
p->version = move (v);
p->state = package_state::fetched;
- p->repository = move (rl);
+ p->repository_fragment = move (rl);
p->archive = move (a);
p->purge_archive = purge;
@@ -153,8 +153,8 @@ namespace bpkg
//
pkg_fetch_check (c, t, m.name, replace);
- // Use the special root repository as the repository of this
- // package.
+ // Use the special root repository fragment as the repository fragment of
+ // this package.
//
return pkg_fetch (c,
t,
@@ -197,14 +197,14 @@ namespace bpkg
if (ap == nullptr)
fail << "package " << n << " " << v << " is not available";
- // Pick an archive-based repository. Preferring a local one over the
- // remotes seems like a sensible thing to do.
+ // Pick an archive-based repository fragment. Preferring a local one over
+ // the remotes seems like a sensible thing to do.
//
const package_location* pl (nullptr);
for (const package_location& l: ap->locations)
{
- const repository_location& rl (l.repository.load ()->location);
+ const repository_location& rl (l.repository_fragment.load ()->location);
if (rl.archive_based () && (pl == nullptr || rl.local ()))
{
@@ -221,14 +221,16 @@ namespace bpkg
if (verb > 1)
text << "fetching " << pl->location.leaf () << " "
- << "from " << pl->repository->name;
+ << "from " << pl->repository_fragment->name;
auto_rmfile arm;
path a (c / pl->location.leaf ());
if (!simulate)
{
- pkg_fetch_archive (co, pl->repository->location, pl->location, a);
+ pkg_fetch_archive (
+ co, pl->repository_fragment->location, pl->location, a);
+
arm = auto_rmfile (a);
// We can't be fetching an archive for a transient object.
@@ -239,7 +241,7 @@ namespace bpkg
if (sha256sum != *ap->sha256sum)
{
fail << "checksum mismatch for " << n << " " << v <<
- info << pl->repository->name << " has " << *ap->sha256sum <<
+ info << pl->repository_fragment->name << " has " << *ap->sha256sum <<
info << "fetched archive has " << sha256sum <<
info << "consider re-fetching package list and trying again" <<
info << "if problem persists, consider reporting this to "
@@ -253,7 +255,7 @@ namespace bpkg
move (n),
move (v),
move (a),
- pl->repository->location,
+ pl->repository_fragment->location,
true /* purge */,
simulate));