aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-unpack.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-10 17:48:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-10 17:48:03 +0200
commitddf8c2b62fa09eb765afc0c093d0d8908f7b69e4 (patch)
tree5956e674e0cb368061a9a9eb6d8bf742f96ffa75 /bpkg/pkg-unpack.cxx
parentec931aa6550b47461e92062a703e6ef9f4c24b17 (diff)
Complete build command
Diffstat (limited to 'bpkg/pkg-unpack.cxx')
-rw-r--r--bpkg/pkg-unpack.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/bpkg/pkg-unpack.cxx b/bpkg/pkg-unpack.cxx
index 7100809..d6613b5 100644
--- a/bpkg/pkg-unpack.cxx
+++ b/bpkg/pkg-unpack.cxx
@@ -23,14 +23,16 @@ using namespace butl;
namespace bpkg
{
- static shared_ptr<selected_package>
- pkg_unpack (database& db,
- const dir_path& c,
+ shared_ptr<selected_package>
+ pkg_unpack (const dir_path& c,
+ transaction& t,
const dir_path& d,
bool replace,
bool purge)
{
- tracer trace ("pkg_unpack(dir)");
+ tracer trace ("pkg_unpack");
+
+ database& db (t.database ());
tracer_guard tg (db, trace);
if (!exists (d))
@@ -52,8 +54,6 @@ namespace bpkg
if (ad.sub (ac))
ad = ad.leaf (ac);
- transaction t (db.begin ());
-
// See if this package already exists in this configuration.
//
const string& n (m.name);
@@ -112,16 +112,17 @@ namespace bpkg
return p;
}
- static shared_ptr<selected_package>
+ shared_ptr<selected_package>
pkg_unpack (const common_options& co,
- database& db,
const dir_path& c,
+ transaction& t,
const string& name)
{
- tracer trace ("pkg_unpack(pkg)");
+ tracer trace ("pkg_unpack");
+
+ database& db (t.database ());
tracer_guard tg (db, trace);
- transaction t (db.begin ());
shared_ptr<selected_package> p (db.find<selected_package> (name));
if (p == nullptr)
@@ -224,6 +225,7 @@ namespace bpkg
level4 ([&]{trace << "configuration: " << c;});
database db (open (c, trace));
+ transaction t (db.begin ());
shared_ptr<selected_package> p;
@@ -236,7 +238,7 @@ namespace bpkg
info << "run 'bpkg help pkg-unpack' for more information";
p = pkg_unpack (
- db, c, dir_path (args.next ()), o.replace (), o.purge ());
+ c, t, dir_path (args.next ()), o.replace (), o.purge ());
}
else
{
@@ -246,7 +248,7 @@ namespace bpkg
fail << "package name argument expected" <<
info << "run 'bpkg help pkg-unpack' for more information";
- p = pkg_unpack (o, db, c, args.next ());
+ p = pkg_unpack (o, c, t, args.next ());
}
if (verb)