aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/pkg-verify.cxx79
1 files changed, 37 insertions, 42 deletions
diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx
index 4cfaa85..0afe32b 100644
--- a/bpkg/pkg-verify.cxx
+++ b/bpkg/pkg-verify.cxx
@@ -56,65 +56,60 @@ namespace bpkg
{
dependency_alternatives da (nv.value);
- for (dependency& d: da)
+ if (da.buildtime)
{
- const package_name& dn (d.name);
-
- if (dn != "build2" && dn != "bpkg")
- continue;
-
- if (!da.buildtime)
+ for (dependency& d: da)
{
- if (diag_level != 0)
- error (p.name (), nv.value_line, nv.value_column)
- << dn << " dependency must be build-time";
+ const package_name& dn (d.name);
- throw failed ();
- }
+ if (dn != "build2" && dn != "bpkg")
+ continue;
- if (da.size () != 1)
- {
- if (diag_level != 0)
- error (p.name (), nv.value_line, nv.value_column)
- << "alternatives in " << dn << " dependency";
+ if (da.size () != 1)
+ {
+ if (diag_level != 0)
+ error (p.name (), nv.value_line, nv.value_column)
+ << "alternatives in " << dn << " dependency";
- throw failed ();
- }
+ throw failed ();
+ }
- if (dn == "build2")
- {
- if (d.constraint && !satisfy_build2 (co, d))
+ if (dn == "build2")
{
- if (diag_level != 0)
+ if (d.constraint && !satisfy_build2 (co, d))
{
- diag_record dr (error);
- dr << "unable to satisfy constraint (" << d << ")";
+ if (diag_level != 0)
+ {
+ diag_record dr (error);
+ dr << "unable to satisfy constraint (" << d << ")";
- if (!what.empty ())
- dr << " for package " << what;
+ if (!what.empty ())
+ dr << " for package " << what;
- dr << info << "available build2 version is " << build2_version;
- }
+ dr << info << "available build2 version is "
+ << build2_version;
+ }
- throw failed ();
+ throw failed ();
+ }
}
- }
- else
- {
- if (d.constraint && !satisfy_bpkg (co, d))
+ else
{
- if (diag_level != 0)
+ if (d.constraint && !satisfy_bpkg (co, d))
{
- diag_record dr (error);
- dr << "unable to satisfy constraint (" << d << ")";
+ if (diag_level != 0)
+ {
+ diag_record dr (error);
+ dr << "unable to satisfy constraint (" << d << ")";
- if (!what.empty ())
- dr << " for package " << what;
+ if (!what.empty ())
+ dr << " for package " << what;
- dr << "available bpkg version is " << bpkg_version;
- }
+ dr << "available bpkg version is " << bpkg_version;
+ }
- throw failed ();
+ throw failed ();
+ }
}
}
}