From 7221a63204a0b2a89e1c72fcbf9f2a7de0a575a3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2015 14:05:22 +0200 Subject: Implement pkg-{configure, disfigure} commands --- bpkg/pkg-unpack.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bpkg/pkg-unpack.cxx') diff --git a/bpkg/pkg-unpack.cxx b/bpkg/pkg-unpack.cxx index 3192c27..7116649 100644 --- a/bpkg/pkg-unpack.cxx +++ b/bpkg/pkg-unpack.cxx @@ -15,9 +15,10 @@ #include #include #include -#include #include +#include + using namespace std; using namespace butl; @@ -63,10 +64,12 @@ namespace bpkg move (m.name), move (m.version), state::unpacked, - optional (), // No archive - false, // Don't purge archive. + optional (), // No archive + false, // Don't purge archive. move (ad), - purge}); + purge, + optional () // No output directory yet. + }); db.persist (p); t.commit (); @@ -86,7 +89,8 @@ namespace bpkg fail << "package " << name << " does not exist in configuration " << c; if (p->state != state::fetched) - fail << "package " << name << " is already in " << p->state << " state"; + fail << "package " << name << " is " << p->state << + info << "expected it to be fetched"; level4 ([&]{trace << p->name << " " << p->version;}); @@ -95,9 +99,7 @@ namespace bpkg // If the archive path is not absolute, then it must be relative // to the configuration. // - path a (*p->archive); - if (a.relative ()) - a = c / a; + path a (p->archive->absolute () ? *p->archive : c / *p->archive); level4 ([&]{trace << "archive: " << a;}); @@ -155,8 +157,8 @@ namespace bpkg throw failed (); } - p->source = d.leaf (); // For now assuming to be in configuration. - p->source_purge = true; + p->src_root = d.leaf (); // For now assuming to be in configuration. + p->purge_src = true; p->state = state::unpacked; -- cgit v1.1