From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6464921707679318016 X-Received: by 10.28.23.200 with SMTP id 191mr1938wmx.25.1505231882884; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.18.81 with SMTP id 78ls442753wms.8.canary-gmail; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Ln95mZItSEE6oFyG27o3rZC3KrI1Z+VJ3L6i3DuJMLo4rACS0PeKg+x6D1DBqQvcKFvfV X-Received: by 10.223.172.196 with SMTP id o62mr915409wrc.10.1505231882499; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505231882; cv=none; d=google.com; s=arc-20160816; b=XfNJY18RFeubpm12mnzwy8Rrr2pMBIKQu8eekoZ4aodTkP6y3OuNa9vBb0M82FTTuY zimwWaOJsU10nSfj8fHdGlG5Kq0GgnGoiU1RzJ8HKh8YhUkMbqukIkHmFGRY2O7MwsqK /sRRBMY/66nYwYhnpWPBkrWfBbbYF94Zx+R0PPQs9KQH2sVGk4E83HXAO/HTNPRZcQK3 mFwJtnxkKJO9lLAw+SHkkGRo2KH9APGw3iqIihzmDNwKU95rL0OCWnstxn1ef9mhwQOg wKRX0LxLyVvfxeYXn2BFFdJLUhXvOPQXvk2cOrhqNeoIj/UVM2ytPDzJo4XyUy2ZQaTK pBbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iOB2k+4mH1Dbwyn7LMRY8YpQJuXlQpU5PBWoY+PMIZk=; b=wTSR43YTaO3ZhE5Db3IwMYDGSlnjmSdrRJ8Q1FKTA0pluIox7CVT5cvt6JBry9kVyS ozopYntd3TJMIP8nBM54BfwQ7b2+QXPq3TR4im4b0pgTkGw/LFyfhsexg0j21+abbh4l hjpoddD3JGACHQaglJZQdmZ+uZdKgBSCMvSBuwNUn2TUyK6f8nwO2wvZpGCYGMXWYEgL /TIF6cwVecUadQyxjkMptAENKm6b3P3PjNgQLRaqovMjPEQpUpsfpGy2uo8A/VpT2FMZ Dc7co6F0Yj70rjKvIzwPTeAL1RbFDvAW6YWsYFsG7HDHM1UMWLxUP6IxDnntI3MHSAyJ y0cA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id v184si221212wmf.9.2017.09.12.08.58.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 08:58:02 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v8CFw1Rl011585 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Sep 2017 17:58:01 +0200 Received: from md1em3qc.ww002.siemens.net ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v8CFw19K001102; Tue, 12 Sep 2017 17:58:01 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Alexander Smirnov , Henning Schild , Claudius Heine Subject: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Date: Tue, 12 Sep 2017 17:58:07 +0200 Message-Id: <20170912155810.9434-4-henning.schild@siemens.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170912155810.9434-1-henning.schild@siemens.com> References: <20170912155810.9434-1-henning.schild@siemens.com> X-TUID: noZN7O0QrUoV Issue: The 'do_build' task in dpkg does more than just building, it also prepares the build environment and cleans it up after building. Other classes building debian packages might need the same steps while implementing the actual build step in a different way. Change: Pull the actual building out into a function that gets called from 'do_build' between the pre and post stuff. Impact: This patch does not change the behaviour of Isar. It addresses the issue and prepares for another patch. Signed-off-by: Henning Schild --- meta/classes/dpkg.bbclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index abd4cef..5c3c1f8 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}" do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" # Build package from sources using build script +dpkg_runbuild() { + sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR} +} + +# Wrap the function dpkg_runbuild with the bind mount for buildroot do_build() { mkdir -p ${BUILDROOT} sudo mount --bind ${WORKDIR} ${BUILDROOT} - sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR} + dpkg_runbuild sudo umount ${BUILDROOT} rm -rf ${BUILDROOT} } -- 2.13.5