From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6878157486786871296 X-Received: by 2002:a63:cd:: with SMTP id 196mr976390pga.424.1601446047804; Tue, 29 Sep 2020 23:07:27 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a62:45:: with SMTP id 66ls418102pfa.1.gmail; Tue, 29 Sep 2020 23:07:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycpLcFKUmpouGnjZV3wGMNH2W4yjxS+ogS23k/gWGwb0kCzht1rtUl3XeKL7gFOCqmtAwM X-Received: by 2002:aa7:948d:0:b029:13e:cb8d:60e0 with SMTP id z13-20020aa7948d0000b029013ecb8d60e0mr1262831pfk.9.1601446047127; Tue, 29 Sep 2020 23:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601446047; cv=none; d=google.com; s=arc-20160816; b=gECqfz3FwlqSPfiuVkLANksg/SWg5dg+MTfFVyNlsQM3tp5KChovygFCnLRWcIysSP PMcdPOjo69Haso+GmXNw99dTU8szQKFmRmfL6t6lhLFhAHEaw9eh1KbhfwH6p0JwGXKf MlD1RyzKKCaqyO6ajpx+lFheECR4wg5ImMDCcfRsHt0IFAx2yCsbMc81fi2T8HRbP+77 6jVyJjB4FDX44SYr3p7nkyJj/EtGWnpRcb8XUqj5sLhYfJ2iE6XwNnx87ujUuKYnfBDb nDlx9Fl4tM6lv/r+3T57Xwc+wYhWhDYVbVtHJQagPoI3eJ37JpGPtA+eHoDJKcEYGwQA K7bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=eNGr2sY82htXXv/f2Ypru+JC6ylWvonjFgG9JC2l700=; b=epvZ9bPbo3BPB2i+FXKawMS7ryAvWCneJkvdS/DluUNyQ3LDnU02QXuP5P4AGiCurk +82jPlqh8Kh7lCKSU21saS9FedFLtSgY4DvZfDq+vluXyFpHN7Y7wv8bED3xS9OPKDdt lvFXdALDyg7nzPWdIjuW30QvA4oGf4HyeguP6t/1Ug6onOulmpQFOMZuCY3XtrZ8dd3+ AKOtnF2tUif2++3uz6b4SFvcvybGTTJ5cAOoFAdIF7Q5Vmk05r2zkvQIa9OKEaBtaPA+ 6OL6Lzz41tDJXnEwiMwcn7pTFcGeo76m+0ECflR0riXN2a+BFl4MvFSHYxw0Twv3NMah 1PNg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id o13si43847pll.3.2020.09.29.23.07.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2020 23:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: naMg+tU+PZOu7GoVFW/URMBJg3WOje2t2vRK1ZX+KhfzyEQJtyAlmXcLgym1whiAU/tnck+Yc1 rmxMYb4iGQAew4szHgwb7wa/47sRl/aQ7/0PbF8XjKGCtrHbUsjHJOip2vDqXsnwI4s9MgNKtC jE9CnSMBgbdXHvLZF5zN+JtOfrnD/EWhjSmJwC0L9SSZhR+jeefm6Wn9u8pvtMFDqdMzAsSEEB qQgJ8zXeGt3L3OuIXbTeIci1vRgNtGXZtAdQr0iQ9khB7ghXg5X24QlfEElz9UN1V+dX0R+NUH 7AY= X-IronPort-AV: E=Sophos;i="5.77,321,1596528000"; d="scan'208";a="53462088" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 29 Sep 2020 22:07:26 -0800 IronPort-SDR: zcqqlSu/Vv6iBN6oq5scNrvdrVN4ztLqG96y1kCA/SfijnvYbPTx9N66z+/DyR0NlTzCooCiZ1 fmasyiOWdCXIkFAKjqf7s3Mq0D8XCt8m5hHIzVFsGI+rDO0uEgOyfuAGcaHmGbX/tG2xSbZWSE Gv5mdFtX3l3wE/euaVwBcfZYeaouTIzvAECirGuJPmDoxi/HvWAZgtuYwag837Pn0zo82OXnbe 9MlFZdfBxM73vZHDstqJvcdlHQv/9vD6XjSQtkky23P9QmxyKIkKjXsyczyzciMyq4eH+SBcfJ c/k= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v6 04/13] deb-dl-dir: Make debsrc_download faster Date: Wed, 30 Sep 2020 11:36:58 +0530 Message-ID: <20200930060707.12785-1-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200930060259.12422-4-Vijaikumar_Kanagarajan@mentor.com> References: <20200930060259.12422-4-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: Cu6xFg/Cft2N 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. Signed-off-by: Vijai Kumar K --- meta/classes/deb-dl-dir.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass index 659fe4b..79a9a88 100644 --- a/meta/classes/deb-dl-dir.bbclass +++ b/meta/classes/deb-dl-dir.bbclass @@ -20,6 +20,8 @@ EOSUDO find "${rootfs}/var/cache/apt/archives/" -maxdepth 1 -type f -iname '*\.deb' | while read package; do 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 sudo -E chroot --userspec=$( id -u ):$( id -g ) ${rootfs} \ sh -c ' mkdir -p "/deb-src/${1}/${2}" && cd "/deb-src/${1}/${2}" && apt-get -y --download-only --only-source source "$2"="$3" ' download-src "${rootfs_distro}" "${src}" "${version}" -- 2.17.1