From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6935855593929310208 X-Received: by 2002:a05:600c:4fc2:: with SMTP id o2mr23577946wmq.25.1617611724491; Mon, 05 Apr 2021 01:35:24 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:58f0:: with SMTP id f16ls7053204wrd.0.gmail; Mon, 05 Apr 2021 01:35:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw38JMJ2604n6vwB5i3vubin/ZqZ9rcEJG4REpSw/1IiucQHLEnG7bhre9Wtyee5qy87n8w X-Received: by 2002:adf:e7c2:: with SMTP id e2mr29313739wrn.338.1617611723658; Mon, 05 Apr 2021 01:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617611723; cv=none; d=google.com; s=arc-20160816; b=xnQocloJElGNsG9RZNjkRlNVPbvZndgC1gRLlpxcYP8Vqe9fTRLHLY9SeELJWMK2Q3 pdO4ya/EbRf8EsHv+T3hsvAee61vVoNITS1KzFY9omMINR3gj4kXFj6AzkEhI8x0s7Kz hHNU5E5tsVvfAx9aXhnDEjdqm8It/swdjoG9Rh7TsKowpEZfUH8eN8fgtiFhJjSi772G 1ba7xbzRUNOcs+WTKwyNprxLg/fjAXy5WS+EuciW33Xr9l0m+6Fx7mX16Zd11pPhAgXG BhCocqcGF/3O4eGcpm1GaBhrm6idTqAeuXAvQXFJN21DNlzwcFjreyZjYXv8IfaCGAsf yBUQ== 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=wt/a4noj1XECmcjduf/Ap33vmB9uz8awcEnSH3hUwsg=; b=U2hCJquRsrWYMXHHuzTLAQBFYJzNO/v3UAjOmp1m/HslN2pqz85fWVsTZGNfwsZk2U kdPzf1akDM92m2ywRGsdUJ1iwF0ZO3GjczoZUniae9t1bPhH5jJnvZMKNhfMp/iGHuV/ tdjl5VllJaWHnIu5rxDC5K5i+jTsbWufeu/2OcO7DGYpofau8THaSmXRyE0owLFKM65J w03BRJKFU7vDDceIk3zvllJBHVZlu7QU4w0UeK1cSUcxZjy2omTuxH4bOkTaTtdYnWgf tKuSOXaO11GhHco25pF9e2N/u8nHZGKvpNcsZKjQKfce4A4r48Qw6Iw/MEYgNPKb0q4D ozDA== 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 r11si2072016wrm.1.2021.04.05.01.35.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Apr 2021 01:35:23 -0700 (PDT) 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: Z7GR591VVywtyQR3zQLjPJpNqHsyGDcO6Gw/qxAHNT4EQ9YiexNIky6BxQNtT8drgYEuI3Ly3q pouYV/zNsrJv9LZuApd9i5sC+4ehLjhLp+qblDSRJSI/pPurh6t9GUcE89kPsENkkPBngwXAsE D5/fo8KNUMuXQuqMlEU7zUCfggea6DqvNxIXU0HRFG8bLXYPISWszIkhBQCJiS0n73hM8Sn+rD 1UqUxAuBXyyy6jVupdu+dhnJH8sgP4hZLwLUNSDsjGmlK3mCnASu6khf8DRErI0gWFQQwrk1Pn 9Gk= X-IronPort-AV: E=Sophos;i="5.81,306,1610438400"; d="scan'208";a="59930278" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 05 Apr 2021 00:35:22 -0800 IronPort-SDR: PUHNvU0tk7apMn3S7FcBUq3NWnCdv4PMtWwqdZD3aZoClbPmPzVtv8WAOhLomT+msIUpqSp9XC iAGHi0+AaE+1mOgOykiNw7uS7xYvwlJT03f42G8Fwi6hxFSfuBHiZhFzrd8Xe7qMlZW/KMX7XP nLLy0AFUrplU4hrxBblJXgZSHK9x5e6cmxM12s9gF9dwZfmkOStgRU80DEoq3Vn5NHQaoGUuF5 Gtllb88ICQtfrB0ckEp2gAKCGedqhSoCoAKOb5uvAEz95HcmSEZYXlswfMs6PBGWd5G9pHTrfw peU= From: Vijai Kumar K To: , , , CC: Vijai Kumar K Subject: [PATCH v5 1/3] dpkg-base: Introduce do_apt_unpack Date: Mon, 5 Apr 2021 14:04:57 +0530 Message-ID: <20210405083459.12277-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210405083459.12277-1-Vijaikumar_Kanagarajan@mentor.com> References: <20210405083459.12277-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: 3I7v/zIBsCnj 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..9f17906 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 --only-source 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