From 74bbd943c042478ac550ba7bf6fec0a14ae14bcf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Dec 2015 13:33:29 +0200 Subject: Ignoring unknown manifest entries where appropriate --- bpkg/fetch.cxx | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'bpkg/fetch.cxx') diff --git a/bpkg/fetch.cxx b/bpkg/fetch.cxx index 2306d4e..f63a6e3 100644 --- a/bpkg/fetch.cxx +++ b/bpkg/fetch.cxx @@ -518,7 +518,8 @@ namespace bpkg fetch_manifest (const common_options& o, const string& host, uint16_t port, - const path& f) + const path& f, + bool ignore_unknown) { string url (to_url (host, port, f)); process pr (start (o, url)); @@ -529,7 +530,7 @@ namespace bpkg is.exceptions (ifdstream::badbit | ifdstream::failbit); manifest_parser mp (is, url); - M m (mp); + M m (mp, ignore_unknown); is.close (); if (pr.wait ()) @@ -608,7 +609,7 @@ namespace bpkg template static M - fetch_manifest (const path& f) + fetch_manifest (const path& f, bool ignore_unknown) { if (!exists (f)) fail << "file " << f << " does not exist"; @@ -620,7 +621,7 @@ namespace bpkg ifs.open (f.string ()); manifest_parser mp (ifs, f.string ()); - return M (mp); + return M (mp, ignore_unknown); } catch (const manifest_parsing& e) { @@ -637,41 +638,45 @@ namespace bpkg static const path repositories ("repositories"); repository_manifests - fetch_repositories (const dir_path& d) + fetch_repositories (const dir_path& d, bool iu) { - return fetch_manifest (d / repositories); + return fetch_manifest (d / repositories, iu); } repository_manifests - fetch_repositories (const common_options& o, const repository_location& rl) + fetch_repositories (const common_options& o, + const repository_location& rl, + bool iu) { assert (rl.remote () || rl.absolute ()); path f (rl.path () / repositories); return rl.remote () - ? fetch_manifest (o, rl.host (), rl.port (), f) - : fetch_manifest (f); + ? fetch_manifest (o, rl.host (), rl.port (), f, iu) + : fetch_manifest (f, iu); } static const path packages ("packages"); package_manifests - fetch_packages (const dir_path& d) + fetch_packages (const dir_path& d, bool iu) { - return fetch_manifest (d / packages); + return fetch_manifest (d / packages, iu); } package_manifests - fetch_packages (const common_options& o, const repository_location& rl) + fetch_packages (const common_options& o, + const repository_location& rl, + bool iu) { assert (rl.remote () || rl.absolute ()); path f (rl.path () / packages); return rl.remote () - ? fetch_manifest (o, rl.host (), rl.port (), f) - : fetch_manifest (f); + ? fetch_manifest (o, rl.host (), rl.port (), f, iu) + : fetch_manifest (f, iu); } path -- cgit v1.1