From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6816610675337461760 X-Received: by 2002:a2e:85d1:: with SMTP id h17mr20309305ljj.70.1588143922338; Wed, 29 Apr 2020 00:05:22 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:3208:: with SMTP id y8ls6189622ljy.6.gmail; Wed, 29 Apr 2020 00:05:21 -0700 (PDT) X-Google-Smtp-Source: APiQypK1R2LukqSEjqrA4Z8oZ1F90tc0EiHf7wQ6pbXT3bN7Wy35xTlg7dK0LbFgQ/tn8xFneb7c X-Received: by 2002:a2e:8912:: with SMTP id d18mr20242921lji.123.1588143921524; Wed, 29 Apr 2020 00:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588143921; cv=none; d=google.com; s=arc-20160816; b=eyKK7a4QJ77xFGIf3t6ACbnjneNKxduo9A/ftIM13R3MAW8S0fwzrwmm+L3BSdexzp 3LVrZ6vOxZyJ2qB9Dov3GNZ5z95Fh7sx1YFoAVNwXQ6R8sm+veBoVIFacLciZkLrwtPR zgkGweQNOrnlzTmtt9+bCdn4W3fNePqmBrhTbdtOqBV6W7r1Fdnl5mDO9ovH3Gd4pkah z+vuHY5gSdhEOPLl0R618S9jxZ6yZJpyqGcU2ey7GwO/N+wDPkRXIUZtLMrTQ9hHwDjo 8nJhiG6rhvgYxKqc/dCzRjMD09BXNdyWzc8hZgl9So9bzcqk8NdAULNyl9yvG9HraDBv qubA== 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=UdaCE3ndA9zat5OAsIOpCZCa2NXyFN8YNP7hMFwl1Z8=; b=mJNNaublHbkwnoGv3XLIJ/Qy9my+wwt4oeMQyuNEaIy2r0AwJW2232LK2Pw2rFeGhw zOOQ6+Wkh5RpY7f8OY/1UmXMWTqO+3T3HANWtyjSX3XB78OEpcf+Y6mz7HqBo276sWyT umF/MzF2qjUB+pfri1P16z65Np4kL/8wnseJci+h+Wawv1lVFAQc8y12jbfRHf9qdSzw fHkFeJAIete9ppodP8ujXx4MvzTocdACo8UwKSQrmF8HxB4ny3YKjCT5KlAIXCHNFrhL JmfcdclN2vGMRpx8bHXp1AuUjuZIKmMCYL7XB4h9yUqiORMFQhLuMgZOleTHwMuiM2wF iyYQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 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 goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id d19si76677lji.3.2020.04.29.00.05.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2020 00:05:21 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 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 goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 03T75KdR028017 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Apr 2020 09:05:20 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.51.203]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 03T75JUA005933; Wed, 29 Apr 2020 09:05:20 +0200 Date: Wed, 29 Apr 2020 09:05:17 +0200 From: Henning Schild To: vijai kumar Cc: isar-users Subject: Re: [PATCH v5 04/13] deb-dl-dir: Make debsrc_download faster Message-ID: <20200429090517.51b8f97e@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20200417093040.15130-1-Vijaikumar_Kanagarajan@mentor.com> <20200417093040.15130-5-Vijaikumar_Kanagarajan@mentor.com> <20200422091539.76f52aaf@md1za8fc.ad001.siemens.net> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TUID: 2j9RaWsz3Cy0 Am Wed, 22 Apr 2020 03:11:11 -0700 (PDT) schrieb vijai kumar : > On Wednesday, April 22, 2020 at 12:45:42 PM UTC+5:30, Henning Schild > wrote: > > > > On Fri, 17 Apr 2020 15:00:31 +0530=20 > > Vijai Kumar K > wrote:=20 > > =20 > > > Eventhough apt-get source skips redownloading of files, it is > > > still slow and takes a lot of time. Instead, lookup if the dsc > > > file is already present in the cache and skip based on it.=20 > > >=20 > > > Signed-off-by: Vijai Kumar K > > > ---=20 > > > meta/classes/deb-dl-dir.bbclass | 3 +++=20 > > > 1 file changed, 3 insertions(+)=20 > > >=20 > > > diff --git a/meta/classes/deb-dl-dir.bbclass=20 > > > b/meta/classes/deb-dl-dir.bbclass index 472b9fe..9399741 100644=20 > > > --- a/meta/classes/deb-dl-dir.bbclass=20 > > > +++ b/meta/classes/deb-dl-dir.bbclass=20 > > > @@ -32,6 +32,9 @@ EOSUDO=20 > > > if [ -z "${src}" ];then=20 > > > src=3D"$( dpkg-deb --show --showformat '${Package}'=20 > > > "${package}" )" fi=20 > > > + # Strip epoch, if any, from version.=20 > > > + local dscfile=3D$(find "${DEBSRCDIR}"/"${rootfs_distro}" > > > -name "${src}_${version#*:}.dsc") =20 > > > > Is that reliable, or might you end up exiting too early. You > > process that "version" quite a bit, it needs to remain a unique > > identifier. So you do not skip "foo-1.2.3_r1@deb~42" only because > > "foo-1.2.3" was there. I made that up but such a version is allowed > > to have all sorts of funny chars.=20 > > =20 >=20 > As per the Debian policy manual, version format is=20 > [epoch:]upstream_version[-debian_revision]. > While downloading using apt-get source =3D, I > observed that epoch is needed > for downloading the source correctly. However the downloaded dsc file > does not contain epoch. Hence > this stripping while checking for the presence of the corresponding > dsc file. >=20 > Also, Debian policy manual[1] states that . + - ~ (full stop, plus, > hyphen, tilde) are the valid values > for use in upstream-version part and + . ~ (plus, full stop, tilde) > for debian-revision part. >=20 > So, this epoch stripping should be fine. Thanks for looking into that. I remember running into a very nasty cornercase once.=20 debian-revision ... It is optional; if it isn=E2=80=99t present then the upstream_version m= ay not contain a hyphen ... But if you are not cutting the string at hyphens you might be fine. Henning > [1]=20 > https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version >=20 >=20 > > > + [ -z "$dscfile" ] || continue =20 > > > > I personally would say "-n" && continue, might be a matter of > > taste. =20 >=20 > =20 > > =20 > Henning=20 > > =20 > > > sudo -E chroot --userspec=3D$( id -u ):$( id -g ) > > > ${rootfs} \ sh -c ' mkdir -p "/deb-src/${1}/${2}" && cd=20 > > > "/deb-src/${1}/${2}" && apt-get -y --download-only --only-source=20 > > > source "$2"=3D"$3" ' download-src "${rootfs_distro}" "${src}"=20 > > > "${version}" =20 > > > > =20 >=20