From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057835350645800960 X-Received: by 2002:a5d:64c3:: with SMTP id f3mr6949544wri.123.1644512109809; Thu, 10 Feb 2022 08:55:09 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:2787:: with SMTP id n129ls1151041wmn.2.gmail; Thu, 10 Feb 2022 08:55:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmjG6Nt10NYJPTnA5m8JycC6u2uoo6T9F35hdZa8wpwlnc+VU7cWqU+bvDjNo0KzJEjOxn X-Received: by 2002:a05:600c:17c7:: with SMTP id y7mr2884283wmo.40.1644512108872; Thu, 10 Feb 2022 08:55:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644512108; cv=none; d=google.com; s=arc-20160816; b=Ln/f9XuhwNvg2hs835qtjETmkKa0c0xaXAHvkhbtlU0T+DvJBjp0QOvpQYV9AfOBwp 8xcAAcTSs5N0uklFCrCXeD4j5cF5SYhswvH7Y25YWasbwvCYrE7WTAwupvupm+1Pohj8 d1NCuQxn3brhR0t2ZcCimLwEvazj/pb8GlDuFue/OGK9kD+Z6jgqGaP+GNYoTAR9vIm8 VyY6siwlyCdHatYIgBopbr6CL217kMEB8+YwlOGBzJ3S5O6mhTMchdeHYjQ+lWSRiiZ3 NM2u4jKEMcMX+7vxHofKAPbsZ2GZp1+CkRrcPKqUdIMu/a5OH3QuDpReOkINkb066ZJj a0sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=0ql5qDIo2tPHJlqQeWJaLbSQM0ZMRg8EN+/OsnqkmvU=; b=KERHzT/iTGTqeCJ1n9ol6G2duzSXFJmUoMOKnvH1QvtMMGU9CwGQBg0BF8zL1+Mkyj ON6EX0z2doFBB86jbXT/5t85Ies+ZYcPUJG2RTJkZGP8IVVSyMPVSY2fMOde6/pyqVXl IYggsbRXTJv91/b+dnJg8e0/Ty2/4o8yiNrrLWRM6sIKGq1liN/vthPkux/Zm6nQUShx mhWX/T8LQzdKa8hZOTcW4MtuSMeiAu8JUq6p++r+hfP+FdSaunlyVCEMaLV2Lakf8LEP tTODyNYQerzlPnr6QpBn0KPFBpWgZqn9RFuowsiWKpzQrt7oMeaesVhFt+8uJq4IVgVU YS0w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id z15si159106wml.1.2022.02.10.08.55.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Feb 2022 08:55:08 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from home.localnet (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 21AGt65f031430 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Feb 2022 17:55:07 +0100 From: Uladzimir Bely To: "Kiszka, Jan (T CED)" , Henning Schild Cc: isar-users@googlegroups.com Subject: Re: [PATCH] deb-dl-dir: Use dpkg-deb --field in debsrc_download Date: Thu, 10 Feb 2022 19:55:04 +0300 Message-ID: <1861231.7Z3S40VBb9@home> In-Reply-To: <20220210132515.52db2852@md1za8fc.ad001.siemens.net> References: <20220127104544.13077-1-ubely@ilbers.de> <20220210132515.52db2852@md1za8fc.ad001.siemens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: 3nZXwuGm8Ckl In the email from Thursday, 10 February 2022 15:25:15 +03 user Henning Schild wrote: > Am Thu, 27 Jan 2022 11:45:44 +0100 > > schrieb Uladzimir Bely : > > In Debian >= bullseye 'dpkg-deb --show --showformat' is currently > > broken in case of requesting virtual fields like 'source:'. > > This makes function 'debsrc_download' broken, so build fails when > > ISAR_USE_CACHED_BASE_REPO 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 > > --- > > > > 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 ffbff077..ded9b3be 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 > > I personally find that hard to read and would appreciate some comments > on it. > Initially, we assume that the "source package" name and version are the same as "package". It's usually true. But sometimes "source package" name may differ. In this case, "Source" field should be specified and we use the value from it. Also, "source package" version may be also specified using parentheses (if it differ from "package" version), in this case we also take it. Some example, when names and version of source package are different: | dpkg-deb --field librtmp1_2.4+20151223.gitfa8646d.1-2+b2_amd64.deb | grep "Source:\|Version\|Package" | Package: librtmp1 | Source: rtmpdump (2.4+20151223.gitfa8646d.1-2) | Version: 2.4+20151223.gitfa8646d.1-2+b2 > In addition i would keep the original code and only take the > alternative approach when src == "". Adding a comment and a TODO revert > pointing to the bug. > I agree that this should be a temorary workaround. Unfortunately, there is no activity at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004372 for two weeks... > Looking at that bug it seems to be a matter of not much time, so the > workaround in isar might not be needed if one had some patience or used > kas-docker 2.6. > > In fact i would prefer to keep that patch out alltogether and wait for > upstream fixes. > Maybe skip the tests doing ISAR_USE_CACHED_BASE_REPO when on bullseye, > or use kas. Oh, I seem to copypasted wrong variable to the commit message. Actually, it is not ISAR_USE_CACHED_BASE_REPO, but BASE_REPO_FEATURES ?= "cache-deb-src". I will fix commit message in the v2 patchset. > > I will send a patch to pin down kas in isar CI. > Jan please note that kas 3.0 will have to wait for #1004372 > > regards, > Henning > > > local dscfile=$(find "${DEBSRCDIR}"/"${rootfs_distro}" -name > > > > "${src}_${version}.dsc") [ -n "$dscfile" ] && continue -- Uladzimir Bely