From b83a9bbdb0407c198e615e61491e1f8492ae5dc9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Oct 2015 08:45:27 +0200 Subject: Add repository location to package, minor cleanups --- bpkg/package | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'bpkg/package') diff --git a/bpkg/package b/bpkg/package index 6bd68cc..67a80a8 100644 --- a/bpkg/package +++ b/bpkg/package @@ -10,6 +10,7 @@ #include #include // uint16 #include +#include // pair #include #include @@ -146,7 +147,7 @@ namespace bpkg complements_type complements; prerequisites_type prerequisites; - // Used to detect recursive fecthing. Will probably be replaced + // Used to detect recursive fetching. Will probably be replaced // by the 'repositories' file timestamp or hashsum later. // #pragma db transient @@ -237,6 +238,16 @@ namespace bpkg // List of repositories to which this package version belongs (yes, // in our world, it can be in multiple, unrelated repositories). // + // Note that if the repository is the special root repository (its + // location is empty), then this is a transient (or "fake") object + // for an existing package archive or package directory. In this + // case the location is the path to the archive/directory and to + // determine which one it is, use file/dir_exists(). While on the + // topic of fake available_package objects, when one is created for + // a selected package (see make_available()), this list is left empty + // with the thinking being that since the package is already in at + // least fetched state, we shouldn't be needing its location. + // std::vector locations; //@@ Map? // Package manifest data. @@ -298,7 +309,7 @@ namespace bpkg std::vector> filter (const shared_ptr&, odb::result&&); - shared_ptr + std::pair, shared_ptr> filter_one (const shared_ptr&, odb::result&&); // state @@ -338,6 +349,17 @@ namespace bpkg version_type version; state_type state; + // Repository from which this package came. Note that it is not + // a pointer to the repository object because it could be wiped + // out (e.g., as a result of rep-fetch). We call such packages + // "orphans". While we can get a list of orphan's prerequisites + // (by loading its manifest), we wouldn't know which repository + // to use as a base to resolve them. As a result, an orphan that + // is not already configured (and thus has all its prerequisites + // resolved) is not very useful and can only be purged. + // + repository_location repository; + // Path to the archive of this package, if any. If not absolute, // then it is relative to the configuration directory. The purge // flag indicates whether the archive should be removed when the -- cgit v1.1