From a7328a438ed26dc0d74238a575c118ca82892b5e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 18 Jun 2016 21:28:19 +0200 Subject: Rename cfg-{add,fetch} to rep-{add,fetch} (aliases stay same) The rationale: we now need the 'add' command for certificates (i.e., add a trusted certificate to the configuration). In the old naming scheme we would have to call it cfg-add which is already taken. In the new scheme we will call it crt-add. --- bpkg/cfg-add.cxx | 66 -------------------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 bpkg/cfg-add.cxx (limited to 'bpkg/cfg-add.cxx') diff --git a/bpkg/cfg-add.cxx b/bpkg/cfg-add.cxx deleted file mode 100644 index 5386fff..0000000 --- a/bpkg/cfg-add.cxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : bpkg/cfg-add.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include - -#include -#include -#include -#include -#include - -using namespace std; -using namespace butl; - -namespace bpkg -{ - int - cfg_add (const cfg_add_options& o, cli::scanner& args) - { - tracer trace ("cfg_add"); - - dir_path c (o.directory ()); - l4 ([&]{trace << "configuration: " << c;}); - - if (!args.more ()) - fail << "repository location argument expected" << - info << "run 'bpkg help cfg-add' for more information"; - - repository_location rl (parse_location (args.next ())); - const string& rn (rl.canonical_name ()); - - // Create the new repository and add is as a complement to the root. - // - database db (open (c, trace)); - transaction t (db.begin ()); - session s; // Repository dependencies can have cycles. - - // It is possible that this repository is already in the database. - // For example, it might be a prerequisite of one of the already - // added repository. - // - shared_ptr r (db.find (rl.canonical_name ())); - - if (r == nullptr) - { - r.reset (new repository (rl)); - db.persist (r); - } - - shared_ptr root (db.load ("")); - - if (!root->complements.insert (lazy_shared_ptr (db, r)).second) - { - fail << rn << " is already a repository of this configuration"; - } - - db.update (root); - t.commit (); - - if (verb) - text << "added repository " << rn; - - return 0; - } -} -- cgit v1.1