diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-22 11:07:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-22 11:07:03 +0200 |
commit | e6f10cabb7fbdba6fd11bcd109dbe765285c762c (patch) | |
tree | 350e0bf1230e930d2c9512eab396a80ffc98b610 /bpkg/pkg-verify.cxx | |
parent | 56af938cd423c1b6730d753ba1ce7b70cd660c29 (diff) |
Implement dependents check in drop command
Also, add support for commands to return program status.
Diffstat (limited to 'bpkg/pkg-verify.cxx')
-rw-r--r-- | bpkg/pkg-verify.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx index 969eb22..5e16410 100644 --- a/bpkg/pkg-verify.cxx +++ b/bpkg/pkg-verify.cxx @@ -208,7 +208,7 @@ namespace bpkg } } - void + int pkg_verify (const pkg_verify_options& o, cli::scanner& args) { tracer trace ("pkg_verify"); @@ -227,9 +227,18 @@ namespace bpkg // If we were asked to run silent, don't yap about the reason // why the package is invalid. Just return the error status. // - package_manifest m (pkg_verify (o, a, !o.silent ())); + try + { + package_manifest m (pkg_verify (o, a, !o.silent ())); + + if (verb && !o.silent ()) + text << "valid package " << m.name << " " << m.version; - if (verb && !o.silent ()) - text << "valid package " << m.name << " " << m.version; + return 0; + } + catch (const failed&) + { + return 1; + } } } |