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/pkg-unpack.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bpkg/pkg-unpack.cxx') diff --git a/bpkg/pkg-unpack.cxx b/bpkg/pkg-unpack.cxx index 9d041e5..483a252 100644 --- a/bpkg/pkg-unpack.cxx +++ b/bpkg/pkg-unpack.cxx @@ -171,7 +171,15 @@ namespace bpkg // Verify the directory is a package and get its manifest. // - package_manifest m (pkg_verify (d, true /* ignore_unknown */)); + package_manifest m ( + pkg_verify (d, + true /* ignore_unknown */, + [&o, &d] (version& v) + { + if (optional pv = package_version (o, d)) + v = move (*pv); + })); + l4 ([&]{trace << d << ": " << m.name << " " << m.version;}); // Check/diagnose an already existing package. @@ -180,9 +188,6 @@ namespace bpkg // Fix-up the package version. // - if (optional v = package_version (o, d)) - m.version = move (*v); - if (optional v = package_iteration ( o, c, t, d, m.name, m.version, true /* check_external */)) m.version = move (*v); -- cgit v1.1