aboutsummaryrefslogtreecommitdiff
path: root/bpkg
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg')
-rw-r--r--bpkg/manifest10
-rw-r--r--bpkg/manifest.cxx24
2 files changed, 22 insertions, 12 deletions
diff --git a/bpkg/manifest b/bpkg/manifest
index 47b8d76..dfbe5af 100644
--- a/bpkg/manifest
+++ b/bpkg/manifest
@@ -337,6 +337,10 @@ namespace bpkg
//
repository_location (const std::string&, const repository_location& base);
+ repository_location (const repository_location& l,
+ const repository_location& base)
+ : repository_location (l.string (), base) {}
+
// Note that relative locations have no canonical name. Canonical
// name of an empty location is the empty name.
//
@@ -428,6 +432,12 @@ namespace bpkg
butl::dir_path path_;
};
+ inline std::ostream&
+ operator<< (std::ostream& os, const repository_location& l)
+ {
+ return os << l.string ();
+ }
+
class repository_manifest
{
public:
diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx
index 1034fe3..1ab9c72 100644
--- a/bpkg/manifest.cxx
+++ b/bpkg/manifest.cxx
@@ -1111,19 +1111,19 @@ namespace bpkg
if (n == "location")
{
- if (!v.empty ())
+ if (v.empty ())
+ bad_value ("empty location");
+
+ try
{
- try
- {
- // Call prerequisite repository location constructor, do not
- // ammend relative path.
- //
- location = repository_location (move (v), repository_location ());
- }
- catch (const invalid_argument& e)
- {
- bad_value (e.what ());
- }
+ // Call prerequisite repository location constructor, do not
+ // ammend relative path.
+ //
+ location = repository_location (move (v), repository_location ());
+ }
+ catch (const invalid_argument& e)
+ {
+ bad_value (e.what ());
}
}
else