From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7032253102499561472 X-Received: by 2002:a7b:c7cd:: with SMTP id z13mr16031300wmk.59.1638968752688; Wed, 08 Dec 2021 05:05:52 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:f1c2:: with SMTP id z2ls1391974wro.2.gmail; Wed, 08 Dec 2021 05:05:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEap5TKVUzvtAm/v4jpgR/m8Da4nWoRzEV6JtIvW982vOOGrbCCyqYOuoAN1uI3Zxle9sh X-Received: by 2002:a5d:62c5:: with SMTP id o5mr58892279wrv.408.1638968751145; Wed, 08 Dec 2021 05:05:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638968751; cv=none; d=google.com; s=arc-20160816; b=CXlCHkcZRmfzjsVCjf4bU5miyqxxEitfZhj7cTeEyQIs1WK/E7LDHwMt1kSF/XvhVD nM7cZEwvFC9aY+0by4YdBougfwLO97I6EK464JKabylwycY72iKmZyNr0SyPNVUFj2q2 KKPvNATfC9kgZXuxyH5jyFZNRXf+4z/rELDutSWJKMMGkkaWnko3gIffiPf/6MU9yKM/ qDR5j1V94LYQoTKJ5EXRKCdqoITdwD1v+JDGXYi/eLA8GUxIl/x3mT14mUkrxH1mPnpK fLLCUrl0n7rpzRO4I0eeug+uEqDI5oiJb5PSeWntsxr9T7asyCr7hCiF/ly1Y0gkEdqi fgOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=eHukbtqHM2Nqyueaj2s77C+nwyDzdXjJtNFRioC0QHs=; b=KYIknAPZC1DQVP29pb7dEC88Kf1EC08aEcM18j3/I33IM5t/q4R3pOVkqQBzXDPd8H uLQS2xko4ywTrErRhB2bBGjjN3y1xeJqX1uX9QFq/j2Vawxr7DZ17DjggstRq1uI6RYZ sjw9BMaWP9cMgHuL0LDTRkSJacO06V8HOAattCYFtS5O6NA1ElHz/dRdSWJLDpOEebd5 iiFU4NO7QoaRbV7tdO6h+2gKGMxlVW4UKhMamnEp+pn8cshUMwZEFLXjzCi/1W4MS1F0 5lRI5qOXP8wAtceSrOsLEcNm3XUeKaelO1nXG2IwAkmJPc2WcRcPp5KrWQ0yoUE9BApO HwsA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id o19si363640wme.2.2021.12.08.05.05.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Dec 2021 05:05:51 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 1B8D5iLI009193 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Dec 2021 14:05:50 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v3 17/20] dpkg-base: Switch apt_fetch and apt_unpack to use schroot Date: Wed, 8 Dec 2021 14:05:41 +0100 Message-Id: <20211208130544.15133-18-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211208130544.15133-1-ubely@ilbers.de> References: <20211208130544.15133-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: Lac80LLQKwCo This moves downloading and unpacking deb-src to schroot environment. Signed-off-by: Uladzimir Bely --- meta/classes/dpkg-base.bbclass | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 34f6e7ab..f10f424f 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -99,34 +99,25 @@ python() { } do_apt_fetch() { - dpkg_do_mounts - E="${@ isar_export_proxies(d)}" - sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \ - -o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \ - -o Dir::Etc::SourceParts="-" \ - -o APT::Get::List-Cleanup="0" - + schroot_create_configs for uri in "${SRC_APT}"; do - sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \ + schroot -d / -c ${SBUILD_CHROOT} -- \ 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}" done - - dpkg_undo_mounts + schroot_delete_configs } addtask apt_fetch after do_unpack before do_apt_unpack do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock" -# Add dependency from the correct buildchroot: host or target -do_apt_fetch[depends] = "${BUILDCHROOT_DEP}" +# Add dependency from the correct schroot: host or target +do_apt_fetch[depends] = "${SCHROOT_DEP}" do_apt_unpack() { rm -rf ${S} - dpkg_do_mounts - E="${@ isar_export_proxies(d)}" - + schroot_create_configs for uri in "${SRC_APT}"; do - sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \ + schroot -d / -c ${SBUILD_CHROOT} -- \ sh -c ' \ set -e dscfile="$(apt-get -y -qq --print-uris --only-source source "${2}" | cut -d " " -f2 | grep -E "*.dsc")" @@ -135,8 +126,7 @@ do_apt_unpack() { dpkg-source -x "${dscfile}" "${PPS}"' \ my_script "${DISTRO}" "${uri}" done - - dpkg_undo_mounts + schroot_delete_configs } addtask apt_unpack after do_apt_fetch before do_patch -- 2.20.1