From fad62fd770129d79e370fc95323543581473cad8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 29 Jan 2019 16:12:21 +0300 Subject: Fix package dependency constraint completions that could end up with latest snapshot --- bpkg/rep-fetch.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bpkg/rep-fetch.cxx') 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 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 v (package_version (co, d)); - - if (v) - sm.version = move (*v); - r.emplace_back (move (sm)); } -- cgit v1.1