From cbd8296c7b86f7fc368d1133da3be3670b7923be Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Dec 2015 11:32:50 +0200 Subject: Clean up command names, add aliases --- bpkg/rep-add.cxx | 70 -------------------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 bpkg/rep-add.cxx (limited to 'bpkg/rep-add.cxx') diff --git a/bpkg/rep-add.cxx b/bpkg/rep-add.cxx deleted file mode 100644 index 0c06ce6..0000000 --- a/bpkg/rep-add.cxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : bpkg/rep-add.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include - -#include // invalid_argument - -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace butl; - -namespace bpkg -{ - int - rep_add (const rep_add_options& o, cli::scanner& args) - { - tracer trace ("rep_add"); - - dir_path c (o.directory ()); - level4 ([&]{trace << "configuration: " << c;}); - - if (!args.more ()) - fail << "repository location argument expected" << - info << "run 'bpkg help rep-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