aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-verify.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/pkg-verify.cxx')
-rw-r--r--bpkg/pkg-verify.cxx81
1 files changed, 45 insertions, 36 deletions
diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx
index a65eeef..f2d9881 100644
--- a/bpkg/pkg-verify.cxx
+++ b/bpkg/pkg-verify.cxx
@@ -68,58 +68,67 @@ namespace bpkg
{
for (const dependency_alternative& da: das)
{
- assert (da.size () == 1); // @@ DEP
-
- const dependency& d (da[0]);
- const package_name& dn (d.name);
-
- if (dn != "build2" && dn != "bpkg")
- continue;
-
- if (das.size () != 1)
+ for (const dependency& d: da)
{
- if (diag_level != 0)
- error (p.name (), nv.value_line, nv.value_column)
- << "alternatives in " << dn << " dependency";
+ const package_name& dn (d.name);
- throw failed ();
- }
+ if (dn != "build2" && dn != "bpkg")
+ continue;
- if (dn == "build2")
- {
- if (d.constraint && !satisfy_build2 (co, d))
+ if (da.size () != 1)
{
if (diag_level != 0)
- {
- diag_record dr (error);
- dr << "unable to satisfy constraint (" << d << ")";
+ error (p.name (), nv.value_line, nv.value_column)
+ << "multiple names in " << dn << " dependency";
- if (!what.empty ())
- dr << " for package " << what;
+ throw failed ();
+ }
- dr << info << "available build2 version is "
- << build2_version;
- }
+ if (das.size () != 1)
+ {
+ if (diag_level != 0)
+ error (p.name (), nv.value_line, nv.value_column)
+ << "alternatives in " << dn << " dependency";
throw failed ();
}
- }
- else
- {
- if (d.constraint && !satisfy_bpkg (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 << "available bpkg version is " << bpkg_version;
+ dr << info << "available build2 version is "
+ << build2_version;
+ }
+
+ throw failed ();
}
+ }
+ else
+ {
+ if (d.constraint && !satisfy_bpkg (co, d))
+ {
+ if (diag_level != 0)
+ {
+ diag_record dr (error);
+ dr << "unable to satisfy constraint (" << d << ")";
- throw failed ();
+ if (!what.empty ())
+ dr << " for package " << what;
+
+ dr << "available bpkg version is " << bpkg_version;
+ }
+
+ throw failed ();
+ }
}
}
}