Bug#1052154: python-debian: Make 'Package-List' a multiline field

Philipp Hahn hahn at univention.de
Mon Sep 18 10:08:57 BST 2023


Source: python-debian
Version: 0.1.39
Severity: wishlist

Dear Maintainer,

according to <man:dsc(5)>
> Package-List:
> package package-type section priority key-value-list
>   This multiline field contains a list of binary packages generated by this source package.

but it is not listed as "Multivalue fields" for "class Dsc" in
<https://salsa.debian.org/python-debian-team/python-debian/-/blob/master/src/debian/deb822.py#L1907-1912>:

> _multivalued_fields = {
>   "files": ["md5sum", "size", "name"],
>   "checksums-sha1": ["sha1", "size", "name"],
>   "checksums-sha256": ["sha256", "size", "name"],
>   "checksums-sha512": ["sha512", "size", "name"],
> }

IMHO the following lines should be added:

> "package-list": ["package", "package-type", "section", "priority", "key-value-list"],

This (slightly) changes the API as the returned type for
`Dsc()["package-list"]` changes, which might break existing code:
  old: str
  new: List[str]

-- System Information:
Debian Release: 11.7
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable-debug'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-25-amd64 (SMP w/4 CPU threads)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de:en_US
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
>From 28601b07cb3f9a46ad989b6b1fefba00363329e5 Mon Sep 17 00:00:00 2001
Message-Id: <28601b07cb3f9a46ad989b6b1fefba00363329e5.1695027946.git.hahn at univention.de>
From: Philipp Hahn <hahn at univention.de>
Date: Mon, 18 Sep 2023 11:01:37 +0200
Subject: [PATCH] fix!: Make Dsc["Package-List"] a multiline field

according to <man:dsc(5)>
> Package-List:
> package package-type section priority key-value-list
>   This multiline field contains a list of binary packages generated by this source package.

Register the field `Package-List` as a multi-valued field.

BREAKING CHANGE: This changes the return type from `str` to `List[str]`.
---
 src/debian/deb822.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/debian/deb822.py b/src/debian/deb822.py
index 2c08797..a1ce4b1 100644
--- a/src/debian/deb822.py
+++ b/src/debian/deb822.py
@@ -1909,6 +1909,7 @@ class Dsc(_gpg_multivalued, _VersionAccessorMixin):
         "checksums-sha1": ["sha1", "size", "name"],
         "checksums-sha256": ["sha256", "size", "name"],
         "checksums-sha512": ["sha512", "size", "name"],
+        "package-list": ["package", "package-type", "section", "priority", "key-value-list"],
     }
 
 
-- 
2.30.2



More information about the pkg-python-debian-maint mailing list