diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-05 08:45:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-05 08:45:27 +0200 |
commit | b83a9bbdb0407c198e615e61491e1f8492ae5dc9 (patch) | |
tree | ce421f55b5b1aa020c6edc3caefc321bbca44157 /bpkg/package | |
parent | 5ae8a9214da9285aa6e7e374288eaf9adc1ba862 (diff) |
Add repository location to package, minor cleanups
Diffstat (limited to 'bpkg/package')
-rw-r--r-- | bpkg/package | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/bpkg/package b/bpkg/package index 6bd68cc..67a80a8 100644 --- a/bpkg/package +++ b/bpkg/package @@ -10,6 +10,7 @@ #include <vector> #include <cstdint> // uint16 #include <ostream> +#include <utility> // pair #include <odb/core.hxx> #include <odb/nested-container.hxx> @@ -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<package_location> locations; //@@ Map? // Package manifest data. @@ -298,7 +309,7 @@ namespace bpkg std::vector<shared_ptr<available_package>> filter (const shared_ptr<repository>&, odb::result<available_package>&&); - shared_ptr<available_package> + std::pair<shared_ptr<available_package>, shared_ptr<repository>> filter_one (const shared_ptr<repository>&, odb::result<available_package>&&); // 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 |