aboutsummaryrefslogtreecommitdiff
path: root/bpkg/cfg-create.cxx
diff options
context:
space:
mode:
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)
{