From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6659727571892043776 X-Received: by 2002:adf:f08c:: with SMTP id n12mr2117235wro.7.1550764743725; Thu, 21 Feb 2019 07:59:03 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a7b:ce03:: with SMTP id m3ls364882wmc.10.canary-gmail; Thu, 21 Feb 2019 07:59:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZupgw/pjxUp5Y1/4kH5/73z5Wz7m8tPsCw/+wxDIg+/9UQx2TRc7Wdiwca1X/tG74zytWr X-Received: by 2002:a1c:a943:: with SMTP id s64mr996838wme.4.1550764743232; Thu, 21 Feb 2019 07:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550764743; cv=none; d=google.com; s=arc-20160816; b=osWK72zYJpqn3cOJBZao8J4kn+uXe5J8qi8n/L7j5uiWK1+pUleWd8ws0sybtKY6Oq og0B1Aeo3isLu8f70j6kmq6ZDJUs2TAmzHIPIAqqEkQz0BSS3AWfx0bJK9xhkAFbGT0j qRa5hhiqFbSWn0mF9ye+wiMMcBxvI6ODD2dxOVaPPxPC0GR5ELeemqUSY+522CmfvcG1 T/DaXwuo7GAb0BoH0kXRxlsA6g1rJ1e3Ga3diBJDtQY+38OX9P7tN6HZYEcXWIjNnY0+ kVEpQvkxp2NR2PkZrE/j/fYmKFDaDDk358Dw8mjL07enKikdD6vWBDx6jyDQhuHJXfMI acuQ== 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=+ZS2bExyAiC8jsnLVdgQmrHnJMJ7qxhhyg9+/8S1DTs=; b=VOGocc5vTcixR3bvHfqy15cVyELt4fZH+CT/JXeOSFOwpnMuNHIxOaE6NwHri+AFC7 +PbTDpb6dqne3EW+StPfzzQ5pUas5kYfbJDd+zQHs7ViDpJJxpq9geegY4NWTj6uY2fX jKg2uWQqswV2Wy+96CtufGvf+UeqE1Zwvy0bl/E3nSxpJ8X5mHD6muV7Ib5jGEkdBGFT qHMMolAZzcKMpcC0wAaJ46B/SJvhO8oqzKbuvtEzSlHoLSI3ZATnfKvP+a88EKCEBXsA seoBkc1tLI04/VkC/01bGURKJW2iDjS3J7prtvhN53qXr/Iwp1LYHg2QUTE86dehi9Bt LPNQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id f2si539374wrq.5.2019.02.21.07.59.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 07:59:03 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id x1LFx2FQ030493 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 21 Feb 2019 16:59:02 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.68.200]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x1LFx02i023487; Thu, 21 Feb 2019 16:59:00 +0100 Date: Thu, 21 Feb 2019 16:59:00 +0100 From: Henning Schild To: isar-users Cc: Vladislav Jasek Subject: Re: [PATCHv3] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup Message-ID: <20190221165900.4077cc24@md1za8fc.ad001.siemens.net> In-Reply-To: <20190221155634.20706-1-henning.schild@siemens.com> References: <20190221155634.20706-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: +ZtAFKcDxpsv Diff to v2: - if arch is "all" do not specify "-A all" but no "-A" at all, which is what we really want - actually tested that with a modified recipe that fetches an all.deb from the internet Henning Am Thu, 21 Feb 2019 16:56:34 +0100 schrieb Henning Schild : > From: Henning Schild > > Instead of using "sed" pattern magic ask the .debs their name and > architecture and remove exactly that. Especially the hardcoded > Architecture caused problems for packages of architecture "all". If > your recipe created such a package it could never be cleaned because > it was added to all the archs of the repo, and later cleaned only > from one. Now if that package changes because you are still working > on the recipe, adding the package again would cause checksum > mismatches for all but the current architecture. > Remove the package from all archs when arch is "all". > > Reported-by: Vladislav Jasek > Signed-off-by: Henning Schild > --- > meta/classes/dpkg-base.bbclass | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/meta/classes/dpkg-base.bbclass > b/meta/classes/dpkg-base.bbclass index 742b8ad..8fb7805 100644 > --- a/meta/classes/dpkg-base.bbclass > +++ b/meta/classes/dpkg-base.bbclass > @@ -98,13 +98,20 @@ do_build() { > CLEANFUNCS += "repo_clean" > > repo_clean() { > - PACKAGES=$(cd ${S}/..; ls *.deb | sed 's/\([^_]*\).*/\1/') > - if [ -n "${PACKAGES}" ]; then > - reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \ > - --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \ > - -C main -A ${DISTRO_ARCH} \ > - remove ${DEBDISTRONAME} \ > - ${PACKAGES} > + DEBS=$( ls ${S}/../*.deb ) > + if [ -n "${DEBS}" ]; then > + for d in ${DEBS}; do > + p=$( dpkg-deb --show --showformat '${Package}' ${d} ) > + a=$( dpkg-deb --show --showformat '${Architecture}' > ${d} ) > + # removing "all" means no arch > + aarg="-A ${a}" > + [ "${a}" = "all" ] && aarg="" > + reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \ > + --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \ > + -C main ${aarg} \ > + remove ${DEBDISTRONAME} \ > + ${p} > + done > fi > } >