From a2b084651909929d58f6b4bc0f3c742d87ee31f6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 27 Apr 2018 15:53:00 +0300 Subject: Add support for repository fragments --- bpkg/cfg-create.cxx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'bpkg/cfg-create.cxx') diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx index b62163e..04d97f4 100644 --- a/bpkg/cfg-create.cxx +++ b/bpkg/cfg-create.cxx @@ -96,10 +96,31 @@ namespace bpkg // database db (open (c, trace, true)); - // Add the special, root repository object with empty location. + // Add the special, root repository object with empty location and + // containing a single repository fragment having an empty location as + // well. + // + // Note that the root repository serves as a complement for dir and git + // repositories that have neither prerequisites nor complements. The + // root repository fragment is used for transient available package + // locations and as a search starting point for held packages (see + // pkg-build for details). // transaction t (db); - db.persist (repository (repository_location ())); + + shared_ptr fr ( + make_shared (repository_location ())); + + db.persist (fr); + + shared_ptr r ( + make_shared (repository_location ())); + + r->fragments.push_back ( + repository::fragment_type {string () /* friendly_name */, move (fr)}); + + db.persist (r); + t.commit (); if (verb && !o.no_result ()) -- cgit v1.1