From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7000667036615442432 X-Received: by 2002:a05:6512:110f:: with SMTP id l15mr3950108lfg.316.1630006739445; Thu, 26 Aug 2021 12:38:59 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:c13:: with SMTP id z19ls967512lfu.0.gmail; Thu, 26 Aug 2021 12:38:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx7vgMYTyBV0wqL7MyzBTuq5ns09QyvP6gosBB9vUSJe8qfsnAmb1wlRK+gMXC19reCwtg X-Received: by 2002:a05:6512:2e8:: with SMTP id m8mr1878287lfq.407.1630006738483; Thu, 26 Aug 2021 12:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630006738; cv=none; d=google.com; s=arc-20160816; b=T9dPgyLWIyRTMUfPwcXp1+8tL6IQwmHGCnncykd1E0ftWDZ5BHcdIF03yodIiqO36c hUibByzxrpJsnE1RKNTS85UZcB96NrlLOJgvXR8FyxUZK447IXp96Dnl6B/ER+KRRNvC DkKO+LvMPYU7poC891yVI4F8LNCjCzkn3fSxdhmPYcDw+bZp9nXrQZmcyPWu9w1WnGxB cMShDl6MWEJJ03QDMtCG+/JtfFvGTeI1FS7kzdFKrrqfTsHG53GCcM7Sz/eKlA9bpc4/ mVhjNws975qUshse7ROFsynIftJmRy0Mqujj8XEXuHvHvN76H80mO30wr+G20Lc2EYEq QaMw== 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:subject:cc:to:from:date; bh=dEhckYULmMIUQ9pegNGl6CXZog7RfHzmFO4RIsHpSt4=; b=QtXMAByld0x5DCaQQamujaClORoPRphE3qZH5/WMusaUGxMEPU/CUXUBoGMmF4lFvL rGZ1dt5nRZPBKVfofFRpVh8ZJtotKijJbcdAfBdE5tJ1/zYT2EvsgCUhfDFTtKXKGeBj Bk1ZoM5KAwl11FydC98C5HUl+4UszlH2jYFQi2BcqGpnwtWxXYGMNqBSa6pZdAmC5NHt EFSj0yO//HCyjJCy/5bl+CxgudY91bu1toLr/s/RpQ1mqOhYpisLLb7IQpC8NqzJpuuj 2Hl7/z7sFJCT/o0IAgm/Du9plYu9Uas3iKoTUDLng0/7yTC083kfgMBjFD4ct4N0XmCP fwTg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id t9si230863lfk.1.2021.08.26.12.38.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Aug 2021 12:38:58 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 17QJcvlc021693 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 26 Aug 2021 21:38:57 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.59]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 17QJcvIL007696; Thu, 26 Aug 2021 21:38:57 +0200 Date: Thu, 26 Aug 2021 21:38:56 +0200 From: Henning Schild To: Jan Kiszka Cc: isar-users Subject: Re: [PATCH 1/2] base: Move SRC_ATP extraction/filtering to dpkg-base class Message-ID: <20210826213856.45583b1d@md1za8fc.ad001.siemens.net> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: fBmg9+XhDPmW Subject typo SRC_ATP/SRC_APT I guess i thought of it as a generic feature that people might want to use also outside of "building packages". It could be used by layers to fetch all sources listed in a manifest. Or something alike. But as long as such code does not exist or is not in Isar, i guess that move can be done. Henning Am Thu, 26 Aug 2021 11:23:28 +0200 schrieb Jan Kiszka : > From: Jan Kiszka > > apt:// SRC_URI entries only make sense for dpkg recipes. So move the > filtering over so that any attempt to use it for other types or > recipes is detected early and that related code is located in the > same classes.s > > Drop redundant expand=True from getVar at this chance. It's default. > > Signed-off-by: Jan Kiszka > --- > meta/classes/base.bbclass | 19 ------------------- > meta/classes/dpkg-base.bbclass | 19 +++++++++++++++++++ > 2 files changed, 19 insertions(+), 19 deletions(-) > > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass > index b7de921..72d4cc0 100644 > --- a/meta/classes/base.bbclass > +++ b/meta/classes/base.bbclass > @@ -138,25 +138,6 @@ def isar_export_proxies(d): > > return bb.utils.export_proxies(d) > > -# filter out all "apt://" URIs out of SRC_URI and stick them into > SRC_APT -python() { > - src_uri = (d.getVar('SRC_URI', True) or "").split() > - if len(src_uri) == 0: > - return > - > - prefix = "apt://" > - new_src_uri = [] > - src_apt = [] > - for u in src_uri: > - if u.startswith(prefix): > - src_apt.append(u[len(prefix) :]) > - else: > - new_src_uri.append(u) > - > - d.setVar('SRC_URI', ' '.join(new_src_uri)) > - d.prependVar('SRC_APT', ' '.join(src_apt)) > -} > - > do_fetch[dirs] = "${DL_DIR}" > do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" > do_fetch[vardeps] += "SRCREV" > diff --git a/meta/classes/dpkg-base.bbclass > b/meta/classes/dpkg-base.bbclass index 8286168..1cac68b 100644 > --- a/meta/classes/dpkg-base.bbclass > +++ b/meta/classes/dpkg-base.bbclass > @@ -73,6 +73,25 @@ addtask patch after do_adjust_git before > do_dpkg_build > SRC_APT ?= "" > > +# filter out all "apt://" URIs out of SRC_URI and stick them into > SRC_APT +python() { > + src_uri = (d.getVar('SRC_URI') or "").split() > + if len(src_uri) == 0: > + return > + > + prefix = "apt://" > + new_src_uri = [] > + src_apt = [] > + for u in src_uri: > + if u.startswith(prefix): > + src_apt.append(u[len(prefix) :]) > + else: > + new_src_uri.append(u) > + > + d.setVar('SRC_URI', ' '.join(new_src_uri)) > + d.prependVar('SRC_APT', ' '.join(src_apt)) > +} > + > fetch_apt() { > sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \ > -o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \