aboutsummaryrefslogtreecommitdiff
path: root/bpkg/cfg-create.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-21 18:08:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-21 18:08:39 +0200
commit221f0250fcd7cba4fa4b5e4fd6c0d410eb6e5811 (patch)
tree3ea5eca558f612fcc9b27db2778d4bfa47e38556 /bpkg/cfg-create.cxx
parent9792fc9d137b4dd702360ac0242f9a7a26e675c2 (diff)
Implement rep-add command
Diffstat (limited to 'bpkg/cfg-create.cxx')
-rw-r--r--bpkg/cfg-create.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx
index 44728b8..be85d92 100644
--- a/bpkg/cfg-create.cxx
+++ b/bpkg/cfg-create.cxx
@@ -9,6 +9,8 @@
#include <fstream>
#include <bpkg/types>
+#include <bpkg/package>
+#include <bpkg/package-odb>
#include <bpkg/utility>
#include <bpkg/database>
#include <bpkg/diagnostics>
@@ -116,7 +118,13 @@ namespace bpkg
// Create the database.
//
- open (c, trace, true);
+ database db (open (c, trace, true));
+
+ // Add the special, root repository object with empty location.
+ //
+ transaction t (db.begin ());
+ db.persist (repository (repository_location ()));
+ t.commit ();
if (verb)
{