From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6935855593929310208 X-Received: by 2002:a2e:9a1a:: with SMTP id o26mr2908613lji.231.1614879723679; Thu, 04 Mar 2021 09:42:03 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:a409:: with SMTP id p9ls1342709ljn.0.gmail; Thu, 04 Mar 2021 09:42:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrd8tw1anrfq/VQbFEIGMCnOuvbpmUzRjBJBYoAuMnytR9EDtqOHKREhyE0M0ecSKzfPJq X-Received: by 2002:a2e:5cc7:: with SMTP id q190mr2797256ljb.37.1614879722492; Thu, 04 Mar 2021 09:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614879722; cv=none; d=google.com; s=arc-20160816; b=Q5n7AgVxUnavbJhubXmhyGHFKZb/H0Wa/w9NDxiLeaUfhkrPVUDhTF62/roR0Az8zr R+ZHI5PoFoXnFXb/2MU1dcYUjag89Z++bMUsuexcTjDjZekfu7ttnwQUt1Lg1Mhwc2Sr e0VTxm4PBv1vyKI2STrymz5gpc7e0vsKqkGgnbVm9SX/g+i28PlKHVgCHphjXfjDI8IT JDqpdeQRWRd+iP+7NxxjlgoLyZbDz6WZY3ZEB/g5SVF0fIRqDJg+ipQQg1fhyBET3Wf7 jZLQ6fRKiqvPJATLNiT/fj0QrRlPi4yQ6X0SVLmAuWgWNs4hDFD+Jr8xFqMXsucstJ6C p7PQ== 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=ZVm26XCT/M1TB29g2vNguA64aiiMO5HUQtnyui8CQ4w=; b=BOSYWpSZLT85ArRf0r9mSXzslVxyC1AB3QrIW7GioCo+GC/0/124/p3A+5YY57du84 9iIXlGaulOzuBfGYHbpu4xZu369tI44OhM9FOQbH7N0Wj/d1NrmYcXWCqtUo0qIaUDBh N6yEDwD+R94muZvYqGfwFVSJNPM1p6edADerxCgVGP8iiAqmKFm25xdjVFoWB9MmKzFz o70NYj18UCdd5nD0l1rEpfeI7UuLKZo7xRZEVAY8iMOEPsrFv3o47P7CO/AYLz+6TUyv Hj+EyzP/It772rZjLSt0Vel72CVMb/+/U+ZLFLExguEtKWXRfGDF4YlbKt8cTIq1oYmU FVWQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id m17si9741lfg.0.2021.03.04.09.42.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Mar 2021 09:42:02 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: e9SpvfkBLlYTsLoar4eyUvFUMXFiwPCqfNOiBfwYS9V29Bk7wjBjdoy/1nvWuuwMn++1+simJ/ onqmS4DNrIDmQdncxUzUoG3iTx8HKA1W0nk/gXo0kRoPa5uyrS3wat0S2Y23aYNR5vpXEG7Fd0 rLCGkpYlfisz0pJxJ3cN6LR5RBQhwwy/rhk0kfHos1rNf5bK49gAKjEtWn9U30c+q14ATxl5kB iJM89OXaP9YkYTvEwYrY/2VQdpqSuLvH7vv7pE6u1G6BMV23GpBI1C2LatmIRTkLHxx+L2IZnR I9I= X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="58899585" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 04 Mar 2021 09:42:01 -0800 IronPort-SDR: uU0ULA+7V4/XWh7Qil2Nh1hkr5MCAUEvaqXj+3JRGusYT0KSu5mip1vovBP5NcLXHE9vWT2Mb7 nuE/dcFnz6kydbMzjILSXlXckRjQbVr2lg4itPIFfmcu6QE9mgwnaMKpd9XiAZLLI9di9igOJH 15HE6uw2MorZfmpOTvxIvVM+h2E16HPzvacOvFB/o0qc9AGQ0OFw06kZXMR8QUO4H5n7LyrYWy QfxzKO+JODht1qbMtZr0Z6N0H0rfEx73YphESDPTxJ5blossYnsD8WWldLvUNRYvY03HtlgYlQ nfo= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v3 1/2] dpkg-base: Introduce do_apt_unpack Date: Thu, 4 Mar 2021 23:11:36 +0530 Message-ID: <20210304174137.11166-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304174137.11166-1-Vijaikumar_Kanagarajan@mentor.com> References: <20210304174137.11166-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: xPVLKXUVjuXy The Debian source package fetch and unpacking happens now inside the do_apt_fetch task. With the current do_apt_fetch implementation, it is not possible to use a custom source directory(${S}). apt-get source by default extracts the contents of the debian source into folder with name _. Add provision for specifying a custom source directory. Add a new task called do_apt_unpack and move unpacking logic there. Signed-off-by: Vijai Kumar K --- meta/classes/dpkg-base.bbclass | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 5c7bddc..c1425bd 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -58,7 +58,6 @@ do_apt_fetch() { if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then return 0 fi - rm -rf ${S} dpkg_do_mounts E="${@ isar_export_proxies(d)}" sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \ @@ -69,16 +68,38 @@ do_apt_fetch() { 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 +addtask apt_fetch after do_unpack before do_apt_unpack do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock" +do_apt_unpack() { + if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then + return 0 + fi + rm -rf ${S} + dpkg_do_mounts + E="${@ isar_export_proxies(d)}" + + for uri in "${SRC_APT}"; do + sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \ + sh -c ' \ + set -e + dscfile="$(apt-get -y -qq --print-uris source "${2}" | cut -d " " -f2 | grep -E "*.dsc")" + cd ${PP} + cp /downloads/deb-src/"${1}"/"${2}"/* ${PP} + dpkg-source -x "${dscfile}" "${PPS}"' \ + my_script "${DISTRO}" "${uri}" + done + + dpkg_undo_mounts +} + +addtask apt_unpack after do_apt_fetch before do_patch + addtask cleanall_apt before do_cleanall do_cleanall_apt[nostamp] = "1" do_cleanall_apt() { -- 2.17.1