aboutsummaryrefslogtreecommitdiff
path: root/libbrep/package.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-04 11:27:47 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-05 15:22:37 +0300
commit6e90b57a442424876b1325b9209f79c8a885a479 (patch)
treebcdc8ee050c05799e17dcca12d7afc80274840d0 /libbrep/package.hxx
parent17d44ec2c41a5b485cecae51a07396f85a601248 (diff)
Make use of foreign package objects in build-related functionality
Diffstat (limited to 'libbrep/package.hxx')
-rw-r--r--libbrep/package.hxx44
1 files changed, 8 insertions, 36 deletions
diff --git a/libbrep/package.hxx b/libbrep/package.hxx
index 4693a34..5a159ae 100644
--- a/libbrep/package.hxx
+++ b/libbrep/package.hxx
@@ -164,18 +164,11 @@ namespace brep
#pragma db value(requirement_alternatives) definition
- // repository_location
- //
- using bpkg::repository_location;
-
- #pragma db map type(repository_location) as(string) \
- to((?).string ()) from(brep::repository_location (?))
-
#pragma db value
class certificate
{
public:
- string fingerprint; // SHA256 fingerprint.
+ string fingerprint; // SHA256 fingerprint. Note: foreign-mapped in build.
string name; // CN component of Subject.
string organization; // O component of Subject.
string email; // email: in Subject Alternative Name.
@@ -202,8 +195,8 @@ namespace brep
explicit
repository (repository_location);
- string name; // Object id (canonical name).
- repository_location location;
+ string name; // Object id (canonical name).
+ repository_location location; // Note: foreign-mapped in build.
string display_name;
// The order in the internal repositories configuration file, starting from
@@ -224,7 +217,8 @@ namespace brep
//
repository_location cache_location;
- // Present only for internal signed repositories.
+ // Present only for internal signed repositories. Note that it is
+ // foreign-mapped in build.
//
optional<certificate_type> certificate;
@@ -342,6 +336,9 @@ namespace brep
optional<email_type> build_email;
dependencies_type dependencies;
requirements_type requirements;
+
+ // Note that it is foreign-mapped in build.
+ //
lazy_shared_ptr<repository_type> internal_repository;
// Path to the package file. Present only for internal packages.
@@ -483,31 +480,6 @@ namespace brep
{
package_id id;
};
-
- #pragma db view object(package) \
- object(repository: package::internal_repository)
- struct package_version
- {
- package_id id;
- upstream_version version;
-
- // Database mapping.
- //
- #pragma db member(version) set(this.version.init (this.id.version, (?)))
- };
-
- #pragma db view object(package) \
- object(repository: package::internal_repository)
- struct package_version_count
- {
- size_t result;
-
- operator size_t () const {return result;}
-
- // Database mapping.
- //
- #pragma db member(result) column("count(" + package::id.name + ")")
- };
}
#endif // LIBBREP_PACKAGE_HXX