aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-fetch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/rep-fetch.cxx')
-rw-r--r--bpkg/rep-fetch.cxx17
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));
}