From fd68f4dd2036c106f047793a1e5656b1ade6fd9d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Oct 2015 08:23:22 +0200 Subject: Add drop command skeleton --- bpkg/drop.cxx | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bpkg/drop.cxx (limited to 'bpkg/drop.cxx') diff --git a/bpkg/drop.cxx b/bpkg/drop.cxx new file mode 100644 index 0000000..ac3919e --- /dev/null +++ b/bpkg/drop.cxx @@ -0,0 +1,52 @@ +// file : bpkg/drop.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include + +#include // cout + +#include // reverse_iterate() + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +using namespace std; +using namespace butl; + +namespace bpkg +{ + void + drop (const drop_options& o, cli::scanner& args) + { + tracer trace ("drop"); + + const dir_path& c (o.directory ()); + level4 ([&]{trace << "configuration: " << c;}); + + if (!args.more ()) + fail << "package name argument expected" << + info << "run 'bpkg help drop' for more information"; + + database db (open (c, trace)); + + // Note that the session spans all our transactions. The idea here is + // that selected_package objects in the satisfied_packages list below + // will be cached in this session. When subsequent transactions modify + // any of these objects, they will modify the cached instance, which + // means our list will always "see" their updated state. + // + session s; + } +} -- cgit v1.1