From 129a1fb4dbc375be0fa926964aa1be46a0cdbbef Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:54:34 +0200 Subject: Adding upstream version 0.1.21. Signed-off-by: Daniel Baumann --- tests/data/custom_plugin.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/data/custom_plugin.py (limited to 'tests/data/custom_plugin.py') diff --git a/tests/data/custom_plugin.py b/tests/data/custom_plugin.py new file mode 100644 index 0000000..41d9779 --- /dev/null +++ b/tests/data/custom_plugin.py @@ -0,0 +1,25 @@ +from debputy.plugin.api import ( + DebputyPluginInitializer, + VirtualPath, + BinaryCtrlAccessor, + PackageProcessingContext, +) + + +def _udeb_metadata_detector( + _path: VirtualPath, + ctrl: BinaryCtrlAccessor, + _context: PackageProcessingContext, +) -> None: + ctrl.substvars["Test:Udeb-Metadata-Detector"] = "was-run" + + +def custom_plugin_initializer(api: DebputyPluginInitializer) -> None: + api.packager_provided_file( + "my-file", + "/no-where/this/is/a/test/plugin/{name}.conf", + post_formatting_rewrite=lambda x: x.replace("+", "_"), + ) + api.metadata_or_maintscript_detector( + "udeb-only", _udeb_metadata_detector, package_type="udeb" + ) -- cgit v1.2.3