From 1fc8b5604778c46a8f867827077034f4660b74f2 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 23 Apr 2021 12:35:43 +0200 Subject: remove redundant values from schema The bd-uninstallable-explainer value null is equivalent to skipping the option and thus dropped. The network value "undefined" is equivalent to skipping the option and thus dropped. Reported-by: David Kalnischkies --- mdbp/build_schema.json | 10 ++++------ mdbp/pbuilder.py | 4 ++-- mdbp/sbuild.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'mdbp') diff --git a/mdbp/build_schema.json b/mdbp/build_schema.json index baa38ef..7997f2e 100644 --- a/mdbp/build_schema.json +++ b/mdbp/build_schema.json @@ -106,14 +106,12 @@ } }, "bd-uninstallable-explainer": { - "enum": [ null, "apt", "dose3" ], - "default": null, - "description": "when installing Build-Depends fails, an explainer can be used to give details" + "enum": [ "apt", "dose3" ], + "description": "When installing Build-Depends fails, an explainer can be used to give details. Without this property, no explainer is run." }, "network": { - "enum": [ "enable", "disable", "try-disable", "try-enable", "undefined" ], - "default": "undefined", - "description": "whether the build should be able to access the internet" + "enum": [ "enable", "disable", "try-disable", "try-enable" ], + "description": "Decide whether the build should be able to access the internet. Without this property, the backend picks its own default. A try-prefixed value does not cause a failure when the request cannot be fulfilled." }, "output": { "type": "object", diff --git a/mdbp/pbuilder.py b/mdbp/pbuilder.py index 07dcac5..e59f262 100644 --- a/mdbp/pbuilder.py +++ b/mdbp/pbuilder.py @@ -20,9 +20,9 @@ def main() -> None: if build.get("lintian", {}).get("run"): raise ValueError("running lintian not supported") - if build.get("bd-uinstallable-explainer"): + if "bd-uninstallable-explainer" in build: raise ValueError("bd-uninstallable-explainer %r not supported" % - build.get("bd-uinstallable-explainer")) + build["bd-uinstallable-explainer"]) if build.get("buildpath"): raise ValueError("buildpath not supported") if build["distribution"] in ("sid", "unstable"): diff --git a/mdbp/sbuild.py b/mdbp/sbuild.py index d2bf2fe..aecc037 100644 --- a/mdbp/sbuild.py +++ b/mdbp/sbuild.py @@ -25,7 +25,7 @@ def main() -> None: "--no-arch-any" if build.get("type") == "all" else "--arch-any", "--no-arch-all" if build.get("type") == "any" else "--arch-all", "--bd-uninstallable-explainer=" + - (build.get("bd-uninstallable-explainer") or ""), + build.get("bd-uninstallable-explainer", ""), "--run-lintian" if build.get("lintian", {}).get("run") else "--no-run-lintian", ] -- cgit v1.2.3