From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057835350645800960 X-Received: by 2002:a5d:6a4e:: with SMTP id t14mr5892344wrw.500.1644737769267; Sat, 12 Feb 2022 23:36:09 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:8bda:: with SMTP id w26ls569462wra.1.gmail; Sat, 12 Feb 2022 23:36:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU7KTPBPWc34YGiI/lzfouK6igTdb9Jvtas2Uooorj94v606+urdPVFAOKJo0fjIDjaixm X-Received: by 2002:a05:6000:2ac:: with SMTP id l12mr1262115wry.370.1644737768377; Sat, 12 Feb 2022 23:36:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644737768; cv=none; d=google.com; s=arc-20160816; b=Kxi37krokJQ9K4X7lTaSygP2VSJ8R7G51TnXddHjiHO4PPTohIbYszbzAG/INIwHXO 4qkvw92S/1AOR9dXzDC9MfIKCK2splBJ9DxzGZGU+VYF6mQKdGJ52aE9HiAr11Vu/npB Ov6jp7GQvu3UDYZn6SiIOuonlMXa6DDY1FyNDt2DLeL9KajAGx7ZceJ8Kury82icO8Gw qqy3zu3wD0uoN42X6VkE/fxuhGAlC9aovbGrOIyMYY0T9rQZ0F8jL6FG39idOHA7v/Jq PWVuS/MkDm13wg9ECdIUg1pK/7EHTfMGv3ZEpNL5P2nbbL+gYT0l30v5SEyBWpMlkOk5 4/cw== 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:to:from; bh=xwHR2CKz7+nsdQarEgY7loEENXXPwYwClIqi4myLYjc=; b=vC+fJVVEb8sI7ACdkn8kDqRWQpcGfAoyv9tabxPDHgc3ARxAWLH0Zu0Z1fxHIknm2Z vxzpxDyc2HnM1FwQ0j+Uo0lmbyLGh0i1p+YQegziF38Qul80X583xf1HfvVe4KZauAlj HA+Qpl9fi2DFpPXQ+11jeGJfDyOOcogzv2/UtGZDF+MsvKUrJU9Soz/JoMczh7Z03vln ZdMzEs+2UeGKjP/4yTgdorpl4JdwgMgLaEZH3FFYVS+Ev8EH1d+2f4hAjEi7we8mpFnm pUJyN3WJwply8hIHWZQv3UjPU+ySOl0XV4idrxh4AzHLjWAiD9o9SrMuzOAqarMAI5e/ MboA== 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 r2si130733wmq.0.2022.02.12.23.36.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Feb 2022 23:36: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 baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 21D7a66e010149 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 13 Feb 2022 08:36:07 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v3 1/1] deb-dl-dir: Use dpkg-deb --field in debsrc_download Date: Sun, 13 Feb 2022 08:36:06 +0100 Message-Id: <20220213073606.27476-2-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220213073606.27476-1-ubely@ilbers.de> References: <20220213073606.27476-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: IVHzUISDDpTy 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 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 --- meta/classes/deb-dl-dir.bbclass | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass index 42542d74..3c489a7b 100644 --- a/meta/classes/deb-dl-dir.bbclass +++ b/meta/classes/deb-dl-dir.bbclass @@ -51,8 +51,15 @@ 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}" )" + # Get source package name if available, fallback to package name + local src="$( dpkg-deb --field "${package}" Source | awk '{printf $1}' )" + [ -z "$src" ] && src="$( dpkg-deb --field "${package}" Package )" + # Get source package version if available, fallback to package version + local version="$( dpkg-deb --field "${package}" Source | awk '{gsub(/[()]/,""); printf $2}')" + [ -z "$version" ] && version="$( dpkg-deb --field "${package}" Version )" + # TODO: get back to the code below when debian bug #1004372 is fixed + # local src="$( dpkg-deb --show --showformat '${source:Package}' "${package}" )" + # local version="$( dpkg-deb --show --showformat '${source:Version}' "${package}" )" local dscfile=$(find "${DEBSRCDIR}"/"${rootfs_distro}" -name "${src}_${version}.dsc") [ -n "$dscfile" ] && continue -- 2.20.1