aboutsummaryrefslogtreecommitdiff
path: root/bpkg
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg')
-rw-r--r--bpkg/manifest4
-rw-r--r--bpkg/manifest.cxx27
2 files changed, 31 insertions, 0 deletions
diff --git a/bpkg/manifest b/bpkg/manifest
index 10d1980..0f03371 100644
--- a/bpkg/manifest
+++ b/bpkg/manifest
@@ -291,6 +291,10 @@ namespace bpkg
std::vector<dependency_alternatives> dependencies;
std::vector<requirement_alternatives> requirements;
+ // The following values are only valid in the manifest list.
+ //
+ butl::optional<butl::path> location;
+
public:
package_manifest (manifest_parser&);
package_manifest (manifest_parser&, manifest_name_value start);
diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx
index 5e8da1a..d080fbb 100644
--- a/bpkg/manifest.cxx
+++ b/bpkg/manifest.cxx
@@ -663,6 +663,30 @@ namespace bpkg
dependencies.push_back (da);
}
+ // Manifest list names. Currently we don't check it is indeed a list.
+ //
+ else if (n == "location")
+ {
+ if (location)
+ bad_name ("package location redefinition");
+
+ try
+ {
+ path l (v);
+
+ if (l.empty ())
+ bad_value ("empty package location");
+
+ if (l.absolute ())
+ bad_value ("absolute package location");
+
+ location = move (l);
+ }
+ catch (const invalid_path&)
+ {
+ bad_value ("invalid package location");
+ }
+ }
else
bad_name ("unknown name '" + n + "' in package manifest");
}
@@ -743,6 +767,9 @@ namespace bpkg
(r.conditional ? "? " : "") +
add_comment (concatenate (r, " | "), r.comment));
+ if (location)
+ s.next ("location", location->posix_string ());
+
s.next ("", ""); // End of manifest.
}