From 67a0e8d70f0caf8b85e0cf2031333236b2a3dcdf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Jan 2016 14:46:19 +0200 Subject: Add checksum verification --- bpkg/rep-info.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bpkg/rep-info.cxx') diff --git a/bpkg/rep-info.cxx b/bpkg/rep-info.cxx index 2205a5b..241f04b 100644 --- a/bpkg/rep-info.cxx +++ b/bpkg/rep-info.cxx @@ -35,9 +35,21 @@ namespace bpkg // Fetch everything we will need before printing anything. Ignore // unknown manifest entries unless we are dumping them. // - repository_manifests rms (fetch_repositories (o, rl, !o.manifest ())); package_manifests pms (fetch_packages (o, rl, !o.manifest ())); + repository_manifests rms; + + try + { + rms = fetch_repositories (o, rl, pms.sha256sum, !o.manifest ()); + } + catch (const checksum_mismatch&) + { + fail << "repository files checksum mismatch for " + << rl.canonical_name () << + info << "try again"; + } + // Now print. // bool all (!o.name () && !o.repositories () && !o.packages ()); -- cgit v1.1