public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 1/1] deb-dl-dir: Use dpkg-deb --field in debsrc_download
Date: Thu, 10 Feb 2022 18:16:47 +0100	[thread overview]
Message-ID: <20220210171647.12607-2-ubely@ilbers.de> (raw)
In-Reply-To: <20220210171647.12607-1-ubely@ilbers.de>

In Debian >= bullseye 'dpkg-deb --show --showformat' is currently broken
in case of requesting virtual fields like 'source:<FieldName>'.
This makes function 'debsrc_download' broken, so build fails when
BASE_REPO_FEATURES ?= "cache-deb-src" is enabled in local.conf

The regression came with the fix for bug #972580 in Debian.
The issue is reported to Debian bugtracker as bug #1004372.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/deb-dl-dir.bbclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 42542d74..6bb8bf64 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -51,8 +51,14 @@ debsrc_download() {
     printenv | grep -q BB_VERBOSE_LOGS && set -x
     find "${rootfs}/var/cache/apt/archives/" -maxdepth 1 -type f -iname '*\.deb' | while read package; do
         is_not_part_of_current_build "${package}" && continue
-        local src="$( dpkg-deb --show --showformat '${source:Package}' "${package}" )"
-        local version="$( dpkg-deb --show --showformat '${source:Version}' "${package}" )"
+        local src="$( dpkg-deb --field "${package}" Source | awk '{printf $1}' )"
+        if [ -z "$src" ]; then
+            src="$( dpkg-deb --field "${package}" Package )"
+        fi
+        local version="$( dpkg-deb --field "${package}" Source |  awk '{gsub(/[()]/,""); printf $2}')"
+        if [ -z "$version" ]; then
+            version="$( dpkg-deb --field "${package}" Version )"
+        fi
         local dscfile=$(find "${DEBSRCDIR}"/"${rootfs_distro}" -name "${src}_${version}.dsc")
         [ -n "$dscfile" ] && continue
 
-- 
2.20.1


      reply	other threads:[~2022-02-10 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 17:16 [PATCH v2 0/1] " Uladzimir Bely
2022-02-10 17:16 ` Uladzimir Bely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220210171647.12607-2-ubely@ilbers.de \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox