aboutsummaryrefslogtreecommitdiff
path: root/bpkg/manifest-utility.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-06-06 23:37:23 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-06-07 13:59:01 +0300
commitefece35aa05ef7f89e3deb0c0017687ddd960af0 (patch)
treee5c0412cf3ed9b9eeaf014c1bd0e8234bb6076b6 /bpkg/manifest-utility.cxx
parentf03160395525ac7e56be5de25544de6032910819 (diff)
Fix uncaught invalid_argument thrown by pkg-build for package like 'foo/1.0.0-'
Diffstat (limited to 'bpkg/manifest-utility.cxx')
-rw-r--r--bpkg/manifest-utility.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/bpkg/manifest-utility.cxx b/bpkg/manifest-utility.cxx
index 8ff2090..74daf6b 100644
--- a/bpkg/manifest-utility.cxx
+++ b/bpkg/manifest-utility.cxx
@@ -82,11 +82,20 @@ namespace bpkg
try
{
- return version (p);
+ version r (p);
+
+ if (r.release && r.release->empty ())
+ throw invalid_argument ("earliest version");
+
+ if (r.compare (wildcard_version, true /* ignore_revision */) == 0)
+ throw invalid_argument ("stub version");
+
+ return r;
}
catch (const invalid_argument& e)
{
- fail << "invalid package version '" << p << "': " << e;
+ fail << "invalid package version '" << p << "' in '" << s << "': "
+ << e;
}
}