[RFC PATCH 0/1] deb-dl-dir: do not assume Version being before Source in RC822 headers

15 views
Skip to first unread message

Cedric Hombourger

unread,
Apr 11, 2025, 2:53:03 AM4/11/25
to isar-...@googlegroups.com, ub...@ilbers.de, Cedric Hombourger
Given the recent announcement for a freeze in preparation of our next
Isar release, I am sending this fix as RFC. Some additional
non-regression testing is being done on our side. Would you have any
objections to get that patch considered prior to releasing?

Cedric Hombourger (1):
deb-dl-dir: do not assume Version being before Source in RC822 headers

meta/classes/deb-dl-dir.bbclass | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--
2.39.5

Cedric Hombourger

unread,
Apr 11, 2025, 2:53:08 AM4/11/25
to isar-...@googlegroups.com, ub...@ilbers.de, Cedric Hombourger, Srinuvasan A
Caching of Debian source packages uses "apt dumpavail" to list sources
known to the apt cache and "apt-ftparchive" to list sources that were
downloaded. With the former, the Source field may appear before the
Version field. The awk script used to list source,version tuples
assuming the following order: Package Version [Source] Size. It now
handles the case where Source may appear before Version (as seen in
the "apt dumpavail" output.

Fixes: 40f67049
Reported-by: Srinuvasan A <srinuv...@siemens.com>
Signed-off-by: Cedric Hombourger <cedric.h...@siemens.com>
---
meta/classes/deb-dl-dir.bbclass | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 75877750..af031ced 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -35,8 +35,12 @@ debsrc_source_version_filter() {
# if <source-version> is not specified then it is <binary-version>.
# The awk script handles these optional fields. It looks for Size: as a
# trigger to print the source,version tupple
- awk '/^Package:/ { s=$2; }
- /^Version:/ { v=$2; next }
+ #
+ # Notes: Source may appear before Version. We however assume that
+ # Package is the first pattern we will match in a package block
+ # and Size the last.
+ awk '/^Package:/ { s=$2; v="" }
+ /^Version:/ { if (v == "") v=$2 }
/^Source:/ { s=$2; if ($3 ~ /^\(/) v=substr($3, 2, length($3)-2) }
/^Size:/ { print s, v}' \
| sort -u
--
2.39.5

Cedric Hombourger

unread,
Apr 12, 2025, 10:11:50 PM4/12/25
to isar-...@googlegroups.com, ub...@ilbers.de, Cedric Hombourger
This is the same bugfix as the RFC PATCH: no regressions observed in
our testing. The commit message was slightly amended to note to
replace "apt dumpavail" with "apt-cache dumpavail".

Cedric Hombourger (1):
deb-dl-dir: do not assume Version being before Source in RC822 headers

meta/classes/deb-dl-dir.bbclass | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--
2.39.5

Cedric Hombourger

unread,
Apr 12, 2025, 10:11:50 PM4/12/25
to isar-...@googlegroups.com, ub...@ilbers.de, Cedric Hombourger, Srinuvasan A
Caching of Debian source packages uses "apt-cache dumpavail" to list
sources known to the apt cache and "apt-ftparchive" to list sources
that were downloaded. With the former, the Source field may appear
before the Version field. The awk script used to list source,version
tuples assuming the following order: Package Version [Source] Size.
It now handles the case where Source may appear before Version (as
seen in the "apt-cache dumpavail" output.

Fixes: 40f67049
Reported-by: Srinuvasan A <srinuv...@siemens.com>
Signed-off-by: Cedric Hombourger <cedric.h...@siemens.com>
---
meta/classes/deb-dl-dir.bbclass | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

Baurzhan Ismagulov

unread,
May 7, 2025, 10:35:57 AM5/7/25
to isar-...@googlegroups.com
Applied to next, thanks.

With kind regards,
Baurzhan
Reply all
Reply to author
Forward
0 new messages