From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6752900179667451904 X-Received: by 2002:a05:651c:1196:: with SMTP id w22mr6631433ljo.217.1573213185928; Fri, 08 Nov 2019 03:39:45 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:c8d8:: with SMTP id y207ls173823lff.14.gmail; Fri, 08 Nov 2019 03:39:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxOTjqYciJM4HMM8AIvmD3VJ7pvXCNL4LT6PltFPgz4eDFl+5O6e7PLoHMwlH50v4WRupmL X-Received: by 2002:ac2:53b0:: with SMTP id j16mr5489289lfh.187.1573213185429; Fri, 08 Nov 2019 03:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573213185; cv=none; d=google.com; s=arc-20160816; b=d4uFpefijvYUHbFYJmK2xXoqeOraO0rtQznTQ0JI/Zj9g5NUPeIewdj0HXRw9/29So nUQjk3JVH75lu4I64G+8QPfkNDi+DqeNTc10aeY7xBjkvh/yU5SjJfVcBwOI4SlhASxH LMY+ms8AR3D9BXO1R95ygg3x48XVTI7IjV1hNABbiPyCxxwBlwaqUjUjntPRCvTgTWA+ VYH+utiLXlFPCtZwgr2GM/kYpNfVIhZeVjk1QOgkRDJpbl/bPl8CuveGiQq5i7Mb6B9T Fb3Su1Tak9+xZme6zuCN5BXapZ0QNbjQh9BB3VCmJqF69DUMO8+kVW9O6dHMwyG7cNLO pxsQ== 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=Rw4ja7yl+ptVajUDnorDpf/5kLvXCQENqda6R6vcQWM=; b=X9rSOk8S0NPEz8eOEc+Ce5kB56WnUMZNqzmN0nBoy6bYsnNV4fijKoZRl2h3gDRhTF g54aXdVVAGntzlzbJ9S+99jgT8cBR8I4cPe6L+UIbR+MeqbhTZGN8XvhmHqzLeJ6bIJr IcDAdq9Lc4LRup6X/iE3u0s/DVKWMjgkuMvZ8/4Y/ODqvvkY5cBy8QxlQRnBCz3lxf1e NBykQN+yJlExUFdDt7IkXAP4u6jpKrRP3d8h9WSJ9nUjqAgUFtB17E3wtXsMn1jMXhrO +1K8GUyI+db/SPrbaY2OeX9V9bsC4Pk57jIh34y+b0d6ONawMGI/isfxVtn2J0b/l5yA PwKA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id k20si283912ljg.0.2019.11.08.03.39.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 03:39:45 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id xA8BdiU3020442 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Nov 2019 12:39:44 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.0.32]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id xA8BdifD032327; Fri, 8 Nov 2019 12:39:44 +0100 Date: Fri, 8 Nov 2019 12:39:35 +0100 From: Henning Schild To: Cc: isar-users Subject: Re: [PATCH 02/17] dpkg-base: add download caching of apt:// downloads Message-ID: <20191108123935.5fc5cede@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20191028170132.28072-1-henning.schild@siemens.com> <20191028170132.28072-3-henning.schild@siemens.com> X-Mailer: Claws Mail 3.17.4 (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: OLWxGmEb+Tgk Am Tue, 29 Oct 2019 05:57:49 -0700 schrieb : > On Monday, October 28, 2019 at 6:01:35 PM UTC+1, Henning Schild wrote: > > > > From: Henning Schild > > > > > Store the results of "apt-get source" in the DL_DIR. This means we > > really only need to fetch once on incemental rebuilds or if > > multiple recipes use the same SRC_URI. > > We can also later collect the results and put them in a repository. > > > > Signed-off-by: Henning Schild > > > --- > > meta/classes/dpkg-base.bbclass | 20 ++++++++++++++++++-- > > meta/conf/bitbake.conf | 1 + > > 2 files changed, 19 insertions(+), 2 deletions(-) > > > > diff --git a/meta/classes/dpkg-base.bbclass > > b/meta/classes/dpkg-base.bbclass > > index 3f1e99f..b39df5c 100644 > > --- a/meta/classes/dpkg-base.bbclass > > +++ b/meta/classes/dpkg-base.bbclass > > @@ -37,14 +37,30 @@ do_apt_fetch() { > > -o Dir::Etc::SourceParts="-" \ > > -o APT::Get::List-Cleanup="0" > > > > - sudo -E chroot --userspec=$( id -u ):$( id -g ) > > ${BUILDCHROOT_DIR} \ > > - sh -c 'cd ${PP} && apt-get -y --only-source source > > ${SRC_APT}' > > + for uri in "${SRC_APT}"; do > > + sudo -E chroot --userspec=$( id -u ):$( id -g ) > > ${BUILDCHROOT_DIR} \ > > + sh -c 'mkdir -p /downloads/deb-src/"$1"/"$2" && cd > > /downloads/deb-src/"$1"/"$2" && apt-get -y --download-only > > --only-source source "$2"' my_script "${DISTRO}" "${uri}" > > + sudo -E chroot --userspec=$( id -u ):$( id -g ) > > ${BUILDCHROOT_DIR} \ > > + sh -c 'cp /downloads/deb-src/"$1"/"$2"/* ${PP} && cd > > ${PP} && apt-get -y --only-source source "$2"' my_script > > "${DISTRO}" "${uri}" > > + done > > + > > dpkg_undo_mounts > > } > > > > addtask apt_fetch after do_unpack before do_patch > > do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock" > > > > +addtask cleanall_apt before do_cleanall > > +do_cleanall_apt[nostamp] = "1" > > +do_cleanall_apt() { > > + if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then > > + exit > > > > shouldn't this be "return 0" instead? > (or are we really wanting to exit the bitbake process here? This is just a copy of the same return condition in the fetching function. I will "return 0" both implementation in another patch. Henning > > > + fi > > + for uri in "${SRC_APT}"; do > > + rm -rf "${DEBSRCDIR}"/"${DISTRO}"/"$uri" > > + done > > +} > > + > > def get_package_srcdir(d): > > s = os.path.abspath(d.getVar("S", True)) > > workdir = os.path.abspath(d.getVar("WORKDIR", True)) > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf > > index bca1114..4c0a809 100644 > > --- a/meta/conf/bitbake.conf > > +++ b/meta/conf/bitbake.conf > > @@ -26,6 +26,7 @@ DEPLOY_DIR = "${TMPDIR}/deploy" > > FILESPATH = > > "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" > > > > FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE', False))}" > > GITDIR = "${DL_DIR}/git" > > +DEBSRCDIR = "${DL_DIR}/deb-src" > > P = "${PN}-${PV}" > > PF = "${PN}-${PV}-${PR}" > > PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', > > False),d)[0] or 'defaultpkgname'}" > > -- > > 2.23.0 > > > > >