summaryrefslogtreecommitdiffstats
path: root/debian/lib/python/debian_linux/utils.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:18:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:18:13 +0000
commit225809f918c2f2c9c831ea16ddb9b81485af5f34 (patch)
tree5332d51631f39fc96804d8001996f028bbbbdf54 /debian/lib/python/debian_linux/utils.py
parentMerging upstream version 6.10.3. (diff)
downloadlinux-225809f918c2f2c9c831ea16ddb9b81485af5f34.tar.xz
linux-225809f918c2f2c9c831ea16ddb9b81485af5f34.zip
Merging debian version 6.10.3-1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/lib/python/debian_linux/utils.py')
-rw-r--r--debian/lib/python/debian_linux/utils.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/debian/lib/python/debian_linux/utils.py b/debian/lib/python/debian_linux/utils.py
index 0c6569b5a0..661a730476 100644
--- a/debian/lib/python/debian_linux/utils.py
+++ b/debian/lib/python/debian_linux/utils.py
@@ -6,6 +6,7 @@ import typing
import jinja2
+from .dataclasses_deb822 import read_deb822
from .debian import SourcePackage, BinaryPackage, TestsControl
@@ -60,14 +61,20 @@ class Templates(object):
return value[0]
- def get_control(self, key: str, context: dict[str, str] = {}) -> BinaryPackage:
- return BinaryPackage.read_rfc822(io.StringIO(self.get(key, context)))
+ def get_control(
+ self, key: str, context: dict[str, str] = {},
+ ) -> typing.Iterable[BinaryPackage]:
+ return read_deb822(BinaryPackage, io.StringIO(self.get(key, context)))
- def get_source_control(self, key: str, context: dict[str, str] = {}) -> SourcePackage:
- return SourcePackage.read_rfc822(io.StringIO(self.get(key, context)))
+ def get_source_control(
+ self, key: str, context: dict[str, str] = {},
+ ) -> typing.Iterable[SourcePackage]:
+ return read_deb822(SourcePackage, io.StringIO(self.get(key, context)))
- def get_tests_control(self, key: str, context: dict[str, str] = {}) -> TestsControl:
- return TestsControl.read_rfc822(io.StringIO(self.get(key, context)))
+ def get_tests_control(
+ self, key: str, context: dict[str, str] = {},
+ ) -> typing.Iterable[TestsControl]:
+ return read_deb822(TestsControl, io.StringIO(self.get(key, context)))
class TextWrapper(textwrap.TextWrapper):