public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH 2/9] base-apt: Introduce base implementaiton
Date: Tue,  2 Oct 2018 14:19:00 +0200	[thread overview]
Message-ID: <20181002121907.18476-3-mosipov@ilbers.de> (raw)
In-Reply-To: <20181002121907.18476-1-mosipov@ilbers.de>

From: Alexander Smirnov <asmirnov@ilbers.de>

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta-isar/conf/layer.conf                          | 10 ++++---
 meta/recipes-devtools/base-apt/base-apt.bb         | 31 ++++++++++++++++++++++
 .../base-apt/files/distributions.in                |  3 +++
 3 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-devtools/base-apt/base-apt.bb
 create mode 100644 meta/recipes-devtools/base-apt/files/distributions.in

diff --git a/meta-isar/conf/layer.conf b/meta-isar/conf/layer.conf
index cd42f06..ae1b3c5 100644
--- a/meta-isar/conf/layer.conf
+++ b/meta-isar/conf/layer.conf
@@ -20,8 +20,10 @@ LAYERDIR_isar = "${LAYERDIR}"
 # Codename of the repository created by the caching class
 DEBDISTRONAME = "isar"
 
-# Path to the Isar apt repository
-DEPLOY_DIR_APT ?= "${DEPLOY_DIR}/apt"
+# Isar apt repository paths
+DEPLOY_DIR_APT ?= "${DEPLOY_DIR}/isar-apt/apt"
+DEPLOY_DIR_DB ?= "${DEPLOY_DIR}/isar-apt/db"
 
-# Path to the Isar databases used by `reprepro`
-DEPLOY_DIR_DB ?= "${DEPLOY_DIR}/db"
+# Base apt repository paths
+BASE_APT_DIR ?= "${DEPLOY_DIR}/base-apt/apt"
+BASE_APT_DB ?= "${DEPLOY_DIR}/base-apt/db"
diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb
new file mode 100644
index 0000000..6ff1164
--- /dev/null
+++ b/meta/recipes-devtools/base-apt/base-apt.bb
@@ -0,0 +1,31 @@
+# This software is a part of ISAR.
+# Copyright (C) 2018 ilbers GmbH
+
+SRC_URI = "file://distributions.in"
+
+inherit base-apt-helper
+
+CACHE_CONF_DIR = "${BASE_APT_DIR}/${DISTRO_NAME}/conf"
+do_cache_config[dirs] = "${CACHE_CONF_DIR}"
+do_cache_config[stamp-extra-info] = "${DISTRO}"
+do_cache_config[lockfiles] = "${BASE_APT_DIR}/isar.lock"
+
+# Generate reprepro config for current distro if it doesn't exist. Once it's
+# generated, this task should do nothing.
+do_cache_config() {
+    if [ ! -e "${CACHE_CONF_DIR}/distributions" ]; then
+        sed -e "s#{DISTRO_NAME}#"${DISTRO_SUITE}"#g" \
+            ${WORKDIR}/distributions.in > ${CACHE_CONF_DIR}/distributions
+    fi
+
+    path_cache="${BASE_APT_DIR}/${DISTRO_NAME}"
+    path_databases="${BASE_APT_DB}/${DISTRO_NAME}"
+
+    if [ ! -d "${path_databases}" ]; then
+        reprepro -b ${path_cache} \
+                 --dbdir ${path_databases} \
+                 export ${DISTRO_SUITE}
+    fi
+}
+
+addtask cache_config after do_build
diff --git a/meta/recipes-devtools/base-apt/files/distributions.in b/meta/recipes-devtools/base-apt/files/distributions.in
new file mode 100644
index 0000000..cc82c57
--- /dev/null
+++ b/meta/recipes-devtools/base-apt/files/distributions.in
@@ -0,0 +1,3 @@
+Codename: {DISTRO_NAME}
+Architectures: i386 armhf arm64 amd64 source
+Components: main
-- 
2.11.0


  parent reply	other threads:[~2018-10-02 12:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 12:18 [PATCH 0/9] Introduce local apt repo to cache upstream debian packages for offline usage Maxim Yu. Osipov
2018-10-02 12:18 ` [PATCH 1/9] base-apt: Add helper class Maxim Yu. Osipov
2018-10-02 13:39   ` Claudius Heine
2018-10-02 12:19 ` Maxim Yu. Osipov [this message]
2018-10-02 14:20   ` [PATCH 2/9] base-apt: Introduce base implementaiton Claudius Heine
2018-10-02 12:19 ` [PATCH 3/9] isar-boot-strap: Add option to keep cache Maxim Yu. Osipov
2018-10-02 14:49   ` Claudius Heine
2018-10-02 12:19 ` [PATCH 4/9] image: Add cache_base_repo task Maxim Yu. Osipov
2018-10-02 12:19 ` [PATCH 5/9] isar-bootstrap: Make possible to reuse the cache Maxim Yu. Osipov
2018-11-02 11:40   ` Henning Schild
2018-10-02 12:19 ` [PATCH 6/9] buildchroot: Make it buildable from base-apt Maxim Yu. Osipov
2018-10-02 12:19 ` [PATCH 7/9] workaround: Use --allow-unauthenticated working with base-apt Maxim Yu. Osipov
2018-10-02 12:19 ` [PATCH 8/9] local.conf: Add option to use cached base repository Maxim Yu. Osipov
2018-10-02 12:19 ` [PATCH 9/9] doc: Creation of local apt repo caching upstream Debian packages Maxim Yu. Osipov
2018-10-02 14:02   ` Claudius Heine
2018-10-02 14:06     ` Jan Kiszka
2018-10-04  9:03     ` Baurzhan Ismagulov
2018-10-05 12:09       ` Claudius Heine
2018-10-11 16:33         ` Baurzhan Ismagulov
2018-10-02 14:05   ` Claudius Heine
2018-11-02 12:00 ` [PATCH 0/9] Introduce local apt repo to cache upstream debian packages for offline usage Henning Schild
2018-11-09  8:04   ` Jan Kiszka
2018-11-09  9:14     ` Baurzhan Ismagulov
2018-11-29 12:53       ` Henning Schild
2018-11-04 10:07 ` Jan Kiszka
2018-11-04 20:20   ` Jan Kiszka

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=20181002121907.18476-3-mosipov@ilbers.de \
    --to=mosipov@ilbers.de \
    --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