public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCHv3 2/8] dpkg-base: introduce an "apt-get source" fetch/unpack step
Date: Thu, 31 Jan 2019 15:18:10 +0100	[thread overview]
Message-ID: <20190131141816.32437-3-henning.schild@siemens.com> (raw)
In-Reply-To: <20190131141816.32437-1-henning.schild@siemens.com>

From: Henning Schild <henning.schild@siemens.com>

This creates a new task to fetch/unpack debian sources from debian
source mirrors. This is done using "apt-get source" and the new variable
APT_SRC to control the arguments.

An example where a original debian package gets rebuild will follow in a
later commit.

based on original patch by Cedric Hombourger <Cedric_Hombourger@mentor.com>

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg-base.bbclass | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index f1b127c..2f324f9 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -20,6 +20,25 @@ do_adjust_git[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
 inherit patch
 addtask patch after do_adjust_git before do_build
 
+SRC_APT ?= ""
+
+do_apt_fetch[depends] = "buildchroot-target:do_build"
+
+do_apt_fetch() {
+	if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
+		exit
+	fi
+	dpkg_do_mounts
+	E="${@ bb.utils.export_proxies(d)}"
+	sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
+		sh -c 'cd ${PP} && apt-get -y source ${SRC_APT}'
+	dpkg_undo_mounts
+}
+
+addtask apt_fetch after do_unpack before do_patch
+do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
+do_apt_fetch[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+
 def get_package_srcdir(d):
     s = d.getVar("S", True)
     workdir = d.getVar("WORKDIR", True)
-- 
2.19.2


  parent reply	other threads:[~2019-01-31 14:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 14:18 [PATCHv3 0/8] apt-get source support Henning Schild
2019-01-31 14:18 ` [PATCHv3 1/8] conf: add deb-src entries to all our distro configs Henning Schild
2019-01-31 14:18 ` Henning Schild [this message]
2019-01-31 14:18 ` [PATCHv3 3/8] meta: move debianization code into a class and into dpkg-base Henning Schild
2019-01-31 15:55   ` Jan Kiszka
2019-01-31 14:18 ` [PATCHv3 4/8] debianize: allow changlog version change Henning Schild
2019-01-31 14:18 ` [PATCHv3 5/8] meta-isar/recipes-app: add upstream hello rebuild example Henning Schild
2019-01-31 15:56   ` Jan Kiszka
2019-01-31 14:18 ` [PATCHv3 6/8] local.conf: enable rebuilding "hello" for all distros Henning Schild
2019-01-31 14:18 ` [PATCHv3 7/8] meta: change apt source fetcher to hook into SRC_URI Henning Schild
2019-01-31 14:18 ` [PATCHv3 8/8] doc: document "apt://" fetch/unpack feature Henning Schild
2019-01-31 14:20 ` [PATCHv3 0/8] apt-get source support Henning Schild
2019-01-31 16:46   ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131141816.32437-3-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox