From 236ad71b105365bedf9d28a5606616fb9aed3168 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Sep 2015 07:16:06 +0200 Subject: Implement pkg-unpack command --- bpkg/pkg-fetch.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'bpkg/pkg-fetch.cxx') 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 p = db.find (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 p (new package { + move (m.name), + move (m.version), + state::fetched, + move (a), + purge, + optional (), // No source directory yet. + false}); db.persist (p); t.commit (); + + if (verb) + text << "fetched " << p->name << " " << p->version; } } -- cgit v1.1