diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-22 08:23:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-22 08:23:22 +0200 |
commit | fd68f4dd2036c106f047793a1e5656b1ade6fd9d (patch) | |
tree | ce033c14fd42e8472b0d7467bbefe9f4f59599db /bpkg/drop.cxx | |
parent | 6fed384f9bdc86fa9bb13d87753d14a886f4f87e (diff) |
Add drop command skeleton
Diffstat (limited to 'bpkg/drop.cxx')
-rw-r--r-- | bpkg/drop.cxx | 52 |
1 files changed, 52 insertions, 0 deletions
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 <bpkg/drop> + +#include <iostream> // cout + +#include <butl/utility> // reverse_iterate() + +#include <bpkg/types> +#include <bpkg/package> +#include <bpkg/package-odb> +#include <bpkg/utility> +#include <bpkg/database> +#include <bpkg/diagnostics> +#include <bpkg/satisfaction> +#include <bpkg/manifest-utility> + +#include <bpkg/common-options> + +#include <bpkg/pkg-purge> +#include <bpkg/pkg-disfigure> + +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; + } +} |