diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-16 07:16:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-16 07:16:06 +0200 |
commit | 236ad71b105365bedf9d28a5606616fb9aed3168 (patch) | |
tree | 3e9c4943c6ea854ed1c931033f7f62916585cd81 /bpkg/pkg-fetch.cxx | |
parent | fbe0716682ad4fd64df670978785db372cbe2ed2 (diff) |
Implement pkg-unpack command
Diffstat (limited to 'bpkg/pkg-fetch.cxx')
-rw-r--r-- | bpkg/pkg-fetch.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx index 9d82446..7558862 100644 --- a/bpkg/pkg-fetch.cxx +++ b/bpkg/pkg-fetch.cxx @@ -88,11 +88,11 @@ namespace bpkg // if (shared_ptr<package> p = db.find<package> (n)) fail << "package " << n << " already exists in configuration " << d << - info << "existing version: " << p->version << ", state: " << p->state; + info << "version: " << p->version << ", state: " << p->state; // Make the archive and configuration paths absolute and normalized. // If the archive is inside the configuration, use the relative path. - // This way we can move configuration around. + // This way we can move the configuration around. // d.complete ().normalize (); a.complete ().normalize (); @@ -102,13 +102,19 @@ namespace bpkg // Add the package to the configuration. // - package p {move (m.name), - move (m.version), - state::fetched, - move (a), - purge}; + shared_ptr<package> p (new package { + move (m.name), + move (m.version), + state::fetched, + move (a), + purge, + optional<dir_path> (), // No source directory yet. + false}); db.persist (p); t.commit (); + + if (verb) + text << "fetched " << p->name << " " << p->version; } } |