diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-10-06 22:16:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-10-07 13:20:53 +0300 |
commit | e253cd97c6a8d55a5be19731d58769f4663ab2d1 (patch) | |
tree | 44a976e7b4ac4d55212cd0b7f2c52a5bf18d8516 /bpkg/fetch-pkg.cxx | |
parent | ed3452457b33bb7a4b2f0abb3ae1fc53f826bc9e (diff) |
Add support for applying backward compatibility workarounds to packages.manifest file generated by rep-create
Diffstat (limited to 'bpkg/fetch-pkg.cxx')
-rw-r--r-- | bpkg/fetch-pkg.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bpkg/fetch-pkg.cxx b/bpkg/fetch-pkg.cxx index 6d9e921..64abb43 100644 --- a/bpkg/fetch-pkg.cxx +++ b/bpkg/fetch-pkg.cxx @@ -168,8 +168,14 @@ namespace bpkg pkg_repository_manifests pkg_fetch_repositories (const dir_path& d, bool iu) { - return fetch_manifest<pkg_repository_manifests> ( - nullptr, d / repositories_file, iu).first; + pkg_repository_manifests r ( + fetch_manifest<pkg_repository_manifests> ( + nullptr, d / repositories_file, iu).first); + + if (r.empty ()) + r.emplace_back (repository_manifest ()); // Add the base repository. + + return r; } pair<pkg_repository_manifests, string/*checksum*/> @@ -184,9 +190,15 @@ namespace bpkg path& f (*u.path); f /= repositories_file; - return rl.remote () + pair<pkg_repository_manifests, string> r ( + rl.remote () ? fetch_manifest<pkg_repository_manifests> (o, u, iu) - : fetch_manifest<pkg_repository_manifests> (&o, f, iu); + : fetch_manifest<pkg_repository_manifests> (&o, f, iu)); + + if (r.first.empty ()) + r.first.emplace_back (repository_manifest ()); // Add the base repository. + + return r; } pkg_package_manifests |