From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6935499186756386816 X-Received: by 2002:a17:902:8209:b029:e3:2c17:73a9 with SMTP id x9-20020a1709028209b02900e32c1773a9mr321413pln.23.1614796739850; Wed, 03 Mar 2021 10:38:59 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90a:16d6:: with SMTP id y22ls1741562pje.3.gmail; Wed, 03 Mar 2021 10:38:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHRij847NTzYVu9yL2AGe+dXWiXFIpnnxRD+bDxWYLOyYCRWh4cvSNqYQZxM/ouO2ZAV+d X-Received: by 2002:a17:90a:b28b:: with SMTP id c11mr480384pjr.62.1614796739007; Wed, 03 Mar 2021 10:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614796739; cv=none; d=google.com; s=arc-20160816; b=OpXJeh5OjTHCxdv1utpTgJWS0X6m4BYg7QQR/AAp3pnerNrOASXvXP4aDPgwiafunW W+8tiVCPWHlKrTG3haauhAFeUZa5eXM11cbZMrZRpyT45k70VNtEIeXm/v3MbRozNA1y T1SPTvJY5NQmsVpioxXQFASvLgfT8tZHhRLf9QSRaNXjfYvSwfn9dYTBjx8DIDCwVW+g emQqyZ6+560WrHtJGV/+cXDBTHf07Kw2bDoPlJyTnYMYlq0Nk2n+dL7E1MbhQqj6Y+bw rEo6xOd8ynLiSGfpMlwg6C+cM8xbXm/FbhqWWcYP4oGmyhPBS92XYkxOdeUIWCKd3dd2 Iv1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=KxeDaMdf6jVWuOuhFmhvlHCTUnB85eNy5lWW9M8GinI=; b=mQnlmm2fMba+GjOMXSaD5/ofZveaMv4Nm0nMJNyDnw52BEbFzA8SzPqiMzczCkHUzN G3uNeWmsU3GT9Ciy17NgUp1bItJiq7NEZR96R4aOhu3UMfwIFnson5/x7cIx1KqVR67O kPRPDlmbQQpJ5MbO+s3mhzlErQ6NPJyhvlyZFw/k9hlp4bb+msrnCIx7ZezGNmsV5G7X WrLMALhCRbulxmCwAhWs5C50A15SqCOraZjvgyx6+h58Qjt88b64HyNjcgn2MkMhMxm1 sH/3+/dG6IVDrHuwsI3Lv9AAS4HBybxa6FT2P9aSm1NVe23EslvFJQclHRf/QRb23lzt uOZg== 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 e200si166513pfh.3.2021.03.03.10.38.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Mar 2021 10:38:58 -0800 (PST) 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: sDk3N19ZIG1gkOWOkknavkRm2CAOQ7X/vhJ+RzUltzuTQxR8nMopnPAWqpdRs5qv7zeHR0DYXH NYaBIzYWvUG5BqLoZndOHImwjCcz8brA2Wg86VHaVIUd2LI3i0ZRTX1Kkk5+y1cEAVIu0pnN2M BADSytsjRHdxcvLpYpy24bB3UmkKi4Y5FZu0aZrsf+6nf76wYwCvEyrRhWWEb+DbW4nDZRQwMw DWIoLFlX/Ep1NKjlL0OoMkJzlYzI9r1PlK7p+XF7DRVCTMEoevyImBL6UZ3Rue8xE+cXuQ9J8l YPs= X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="58707956" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 03 Mar 2021 10:38:58 -0800 IronPort-SDR: j/KU4prAAW2zX3hhnnMLVF814aBai/ct09Bzpjj7r3aD8qAMKV8x7EDq9eDZYHx5hOVoUGc/mc MVPDAOa2kmuHkhr7HsKxbgLBZHV1JDIpRwKvu+ECaIX/cA83Y2sFuDApZK8RLNvL8WUlUyqkhJ qFG1xMzdVbBL983fk2A1ztYcCzfMduBFCnWG7c9R46IzvYx0gcq4gHmiUjAzro1IR4woHL+nGY kL3NywTR/l/bc2kR2RIWqVut2LjBmS/LugHMqmy8uAM+T0pFYXxfgSX3AttFBqfNHb4j8261hs ILc= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v2] dpkg-base: Introduce do_apt_unpack Date: Thu, 4 Mar 2021 00:08:23 +0530 Message-ID: <20210303183823.11563-1-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 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: JP3iVTcNhjro 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 | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 5c7bddc..a6c2e3b 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,8 +68,6 @@ 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 @@ -79,6 +76,27 @@ do_apt_fetch() { addtask apt_fetch after do_unpack before do_patch do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock" +do_apt_unpack() { + 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