diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-01-29 16:12:21 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-01-30 15:54:59 +0300 |
commit | fad62fd770129d79e370fc95323543581473cad8 (patch) | |
tree | c12dc09c0bfead4ed606c4c23702426c2737d41b /bpkg/rep-fetch.cxx | |
parent | d5e755ebe85271e65d69afb38d6548d33e55e79e (diff) |
Fix package dependency constraint completions that could end up with latest snapshot
Diffstat (limited to 'bpkg/rep-fetch.cxx')
-rw-r--r-- | bpkg/rep-fetch.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bpkg/rep-fetch.cxx b/bpkg/rep-fetch.cxx index 83a30f9..b64bbe2 100644 --- a/bpkg/rep-fetch.cxx +++ b/bpkg/rep-fetch.cxx @@ -231,7 +231,15 @@ namespace bpkg { ifdstream ifs (f); manifest_parser mp (ifs, f.string ()); - package_manifest m (mp, iu); + + package_manifest m ( + mp, + [&co, &d] (version& v) + { + if (optional<version> pv = package_version (co, d)) + v = move (*pv); + }, + iu); // Save the package manifest, preserving its location. // @@ -249,13 +257,6 @@ namespace bpkg fail << "unable to read from " << f << ": " << e; } - // Fix-up the package version. - // - optional<version> v (package_version (co, d)); - - if (v) - sm.version = move (*v); - r.emplace_back (move (sm)); } |