From patchwork Tue Mar 30 21:32:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijai Kumar K X-Patchwork-Id: 397 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:378f:0:0:0:0:0 with SMTP id r137csp206999oor; Tue, 30 Mar 2021 23:33:20 -0700 (PDT) X-Received: by 2002:a65:4481:: with SMTP id l1mr1737382pgq.453.1617172400193; Tue, 30 Mar 2021 23:33:20 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1617172400; cv=pass; d=google.com; s=arc-20160816; b=gCZft5/HNTHVxvzgyLNWFO6enh9dO0Zt9zWepLS1dj9Q97kmfcRcLK4pA0jLsiGXA3 ZVqFJiQRALVymlPa7zw2JC/N25c6qLtTjV/wLTmUxDEi4crU1Mgws2hFOFWK6LhRboqe YGs3meEFfsayBfkqn6wESnR+uw1xEyn05IgC5HaCzajg8YieFnATsNEfHE3zmV8AhPrI qUWMhm0n3RueKUWvvK0xS11038tmRNOARMvJCM9r9SPSG9ZBYLDcgE3DXPIAXARa7ax9 K4gkxYKzhiBHDGvdYLrQxbP0VCnG7Ax6p2UFK6KHBAXj1Pr/gTpI5nam3xd1a3+rFt+m pqSA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=AawM2gswCuOxJwSkVVdguPVnljvuXXhPMG+EkTuK/pA=; b=rEZd5hwNaxbWVHrjDrtqd+X30nPkcKQTawSy7j7oC7H9jwCoIPKePRdoPG8LlxVY/C uvQaPxwXadOc7ggiwYwqAaAH9V/v1KhzfqObIZ+PBBIuHwREGW+lUYbX203fB1TJ1RnK 4BE9LjkkvGeZTdkQZMhptySZNAJWSVJXueIyhyW/NWNc7ddLy8qYXOgbI4ijJekb8NWH lcCJ6ZTvOBOIgn3l5mkiPKY3iu7Co/WiAmwIPAFBX+zoEgh50V7Ko0WzTRir2LVY4IeB gzAby9x/vgdg+LIqF+i77pCY9GILQJpoRaObgzE2dXtIKkN2Sf8KAFGWVPJ2OCq5kzsI C5uQ== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=S2B5Uh2v; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbl5pscbqmgqeuob5why@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBL5PSCBQMGQEUOB5WHY@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id j16sor642353pgk.72.2021.03.30.23.33.19 (Google Transport Security); Tue, 30 Mar 2021 23:33:20 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbl5pscbqmgqeuob5why@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=S2B5Uh2v; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbl5pscbqmgqeuob5why@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBL5PSCBQMGQEUOB5WHY@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1617172399; cv=pass; d=google.com; s=arc-20160816; b=CmBhMAaId66oQqkSAgBZll5Ap7MPpGEFDak20xEbDOocBE1FhaNRWgctj9fNQZ2Hu/ UA+4xzzbi2LnX4uW1pvsddiL6CZO3reDSJ0bGih6weeMx58phVKER84E8LcmElFPThSl heAAOvazsZEOI1+/ZkIcsyp/5uTmWKy5KOLXuCHxgEOidIss3YPiR0G5fjO8bcmOvB0G RPYTFJWNIoI46j1NqXBvuMZ02KvmuXGRMbU2xKPwCER8uOpjtZpzsIT6YHVxj2XwCpJd Ih6B54xNdmLZVEROHN+CPLbnaIG6JxkxFl21/C2Ql/ijNCaJxqkEn8vrL19upZMvCN1G 0a1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=AawM2gswCuOxJwSkVVdguPVnljvuXXhPMG+EkTuK/pA=; b=0j9rM2+aLKQ3Y4rcyNeS6CE2Oe5bYYYWyGurCT95KG7z39eLW1TffNKRT4u2Abf5QJ sdRUtfQrH5m4ytYlsd0mLrZMSS/MjgUah21n1zutVJMI4o7s3mN/DMxapgr4WvI4dTe3 jwg/4I9BEC9dkHL6EIi/wx9TW5IN9AkYobj7gbabmgII1WxwYnfjTKgXvFqx2RB+BCUW +az90TpyRN2zgM4tswS7g5Hn2ac/b0FAgBDHImTSTS2jBhSjTC0ER4KyoU4/f7tggRLC 8xis1+2JYWefj9sFNcPaiydgkVSTGS+d5esHCHtFZXr5Vg2vubIu7wp0+3AQmB78B7uV 0Wjw== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=AawM2gswCuOxJwSkVVdguPVnljvuXXhPMG+EkTuK/pA=; b=S2B5Uh2vCl9d0XK97h+CIVoqSCLW8mGR/Vg7ubyfK1newScI3aaIeNaC0gxCtLUhe0 9G7gkbAO65Ld36yrDgLWXDZCtmbRi7iZVO1TNvg+1QGFXC7AgOKaw4D2ngY7WShWncQI bJ1TJWCMPFFasunPKHIn6ESsWjvLZwnPnRD7i82GqgafcokWfmgICigIh4egWy38t3S9 zow6ItmDSW+WwEkoUPI/SuBqaqBRhB1eFBTEc71wkOZg12HWF4XbWN68Z1n81JicObJW abxN0pAEdrVzDPrrZrw11Jgc/ltx6Ly2b+VtTCX7p72VN7acZPXxwQVSKajb65c0ztMK qjkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=AawM2gswCuOxJwSkVVdguPVnljvuXXhPMG+EkTuK/pA=; b=PPrRpcb8UztqvaREvHzH+fcQTdqG9f4gYTt/xfE6J+LqQtpXv8IgvatFCwq2b2EQHt US/AlaeMRnuJiKaMNf6Tj5vEN9xbwuawYHgAKONlIbTq+6rkwQTUAybUzkazXQPvQHZ0 6sEykXYEepIdzvF9quo/PN09qN/h6SzevUMqMjU6ubu9mfo0t7W2fsTJZifjpiGG5/aP 9n+1FaEik60y+31BEw+SuPh3mE1Huztr4Ifsscf/oKdUyC18hDoTcgbl8dDssNq71UZ6 ka8Z7GTVfTalgBJ3Qdgx6Fv7RVq4c3gcUw/xlEkv6NNswBuIEsuHkRzvKm7SygWSR7Fr 5CJQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM5336hpvKfppe+ssGHOVINUME+/QOCHa0/QSpmnG3ysM8lRHJRt3V rRbHFa9OMGOk5xgKdG9OOx8= X-Google-Smtp-Source: ABdhPJwUdobz64JgNRSJFYcgwaluQURr/h5JMbtS6uyIYMVNlAuwK67T80FVfuCDduFxRgq0y6Le8w== X-Received: by 2002:a63:4442:: with SMTP id t2mr1862397pgk.232.1617172399760; Tue, 30 Mar 2021 23:33:19 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90a:cb0b:: with SMTP id z11ls834886pjt.2.canary-gmail; Tue, 30 Mar 2021 23:33:19 -0700 (PDT) X-Received: by 2002:a17:903:31c6:b029:e5:d0a4:97cc with SMTP id v6-20020a17090331c6b02900e5d0a497ccmr1627944ple.52.1617172399075; Tue, 30 Mar 2021 23:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617172399; cv=none; d=google.com; s=arc-20160816; b=yZqe+cyI3VhL96OIl5L0yBG4Svoq1BGHF5wjd4FITA+4+c7Vbc8oMqwI/HnxhwHz/j 8gCkFkyaL+/pWQd+s5BWp8c/8W9jXetXhArd/yeftLSwEJB0XeIG4wqpUv/v4+q3C+A4 xuiosIphnQE2Ft2X4SxHueTY/qmW7XaA0o1wVZfcA4XMFQlGSCii1OwqxNlc0jCgDQn2 pR9oariWrppxGcQIo39nzp/QrFTnNltTjoXFv5/5vRW4CLnOjiImuoFFcCxh1kjAFAhd ZiNfBtpIyW0qcsHOMkbuvqKeqs+tgeSkDKRZmfmZsazqC08gEaXtaQa4X8J7Moyp/Dx8 rqcA== 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=s3gHdx/hzyrWAsyLQSLobhFCifpo2CxUKvEuVwQKxE9ZFpUDSMxKFW5DqhoDZBT0fi LQHB3XLTFErcy0TMetH5rh++ict8vR7IOqoZJ5GldBJg58+g33dWywT/B/Ss8dTvCfcb IIeRhmTnurPU0gp6+BFcO75OP/4BMR2lYu+k2puG31papkwfX8pefhisbyptXAA8XG7A sgE08Q27HX8SSC3TmPwzXbgObGYyk6mAMhBWJlNhtsFIObk6nKQ0DYxDe/AFrJq/PgXQ zbaYueyXED8vgARFqPaqMAdTXReXMFE074+zJ1EhfAjy93MbGc/aUT7BAocsMDTvjWtG ClOA== 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 Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id n10si93853pgq.2.2021.03.30.23.33.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Mar 2021 23:33:19 -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; IronPort-SDR: l/H+l3ILnbkvAJHx3GOH+6tCsoTnCoLz+I6WC0DkyycDlB6Hskg8bvSk+9Xo50ju3r+CG+/jDt 8da4duR6B9j3hSPXalJAugGd0jCAqRHKaGXVIdJJ6XfMHnpPDvq/brPwXtaFvcEnBTDaCat6YF Ueb93E7Y+RNCa2uydRPlMQwaaSF0adnJqsWGm93JFeOOYk14zbLTisGb0PA5EhnCPyyaLFA091 zueS3nLbVWLon0frguDSfVlmzQWmsY1dYG95sYQvaThamzugg49X0YM8rBs+sEVW+Ngb4z0t+y EpM= X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="59645875" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 30 Mar 2021 22:33:18 -0800 IronPort-SDR: r/xnrUOgvv7yf/Sw1H1fXmBU1Etxg4f7JP8MkCVi4dQItNDPLRGVP9Pa57SsXXcq3ScViNDicH /MaXgncmdPBrci5D5FYlQmh/gnqA5fz519g9HnzKwgDcC22AaQ4GVXINGMLk38WmrIY7YSOD75 QLyLHmGKmHaBNpqFnhyXHBgKBJ5GYCxWuQKhsjPdXTU0OmN5eUlm5xuh6Befkvg4ohzijAccoq 0vgn7tpI9ikX54vLkpCJc7xa+wb/gTopSjXMcMUFxC8j/0+XaISMOcflTf0n+8dTcF5+m2UEbl w8g= From: Vijai Kumar K To: , , CC: Vijai Kumar K Subject: [PATCH v4 1/2] dpkg-base: Introduce do_apt_unpack Date: Wed, 31 Mar 2021 12:02:34 +0530 Message-ID: <20210331063235.6877-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210331063235.6877-1-Vijaikumar_Kanagarajan@mentor.com> References: <20210331063235.6877-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-Original-Sender: vijaikumar_kanagarajan@mentor.com X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1695728166878330877?= X-GMAIL-MSGID: =?utf-8?q?1695728166878330877?= 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() {