aboutsummaryrefslogtreecommitdiff
path: root/bpkg
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
parentf03160395525ac7e56be5de25544de6032910819 (diff)
Fix uncaught invalid_argument thrown by pkg-build for package like 'foo/1.0.0-'
Diffstat (limited to 'bpkg')
-rw-r--r--bpkg/manifest-utility.cxx13
-rw-r--r--bpkg/pkg-build.cxx2
2 files changed, 12 insertions, 3 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;
}
}
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 590dbe9..0844ae9 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -1777,7 +1777,7 @@ namespace bpkg
return dependency_constraint ("~" + vs);
}
// Note that the only possible reason for invalid_argument exception to
- // be thrown is that minor version reached the 999 limit (see
+ // be thrown is that minor version reached the 99999 limit (see
// standard-version.cxx for details).
//
catch (const invalid_argument&)