public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Benedikt Niedermayr <benbrenson89@googlemail.com>
To: isar-users@googlegroups.com
Cc: Benedikt Niedermayr <Benedikt.Niedermayr@mixed-mode.de>
Subject: [PATCH 6/6] Added support for installing isar packages to local isar repository.
Date: Tue,  6 Feb 2018 11:09:39 +0100	[thread overview]
Message-ID: <1517911779-30507-7-git-send-email-Benedikt.Niedermayr@mixed-mode.de> (raw)
In-Reply-To: <1517911779-30507-1-git-send-email-Benedikt.Niedermayr@mixed-mode.de>

Installs packages to the local Isar reposiory within the do_deploy_deb task.
The cache_add_package function does the following:
- Add the package to the repository database
- Update the published repository

Signed-off-by: Benedikt Niedermayr <Benedikt.Niedermayr@mixed-mode.de>
---
 meta/classes/dpkg-base.bbclass | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 026028f..896d31d 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -1,6 +1,8 @@
 # This software is a part of ISAR.
 # Copyright (C) 2017 Siemens AG
 
+inherit apt-cache
+
 # Add dependency from buildchroot creation
 do_build[depends] = "buildchroot:do_build"
 
@@ -20,10 +22,14 @@ dpkg_runbuild() {
 do_build() {
     mkdir -p ${BUILDROOT}
     sudo mount --bind ${WORKDIR} ${BUILDROOT}
+    sudo mount --bind ${TOPDIR}/apt-cache/${DISTRO} ${BUILDCHROOT_DIR}/apt-cache
     _do_build_cleanup() {
         ret=$?
         sudo umount ${BUILDROOT} 2>/dev/null || true
         sudo rmdir ${BUILDROOT} 2>/dev/null || true
+
+        sudo umount ${BUILDCHROOT_DIR}/apt-cache 2>/dev/null || true
+        sudo rmdir ${BUILDCHROOT_DIR}/apt-cache 2>/dev/null || true
         (exit $ret) || bb_exit_handler
     }
     trap '_do_build_cleanup' EXIT
@@ -31,13 +37,10 @@ do_build() {
     _do_build_cleanup
 }
 
-# Install package to Isar-apt
+
+# Install package to isar repository
 do_deploy_deb() {
-    reprepro -b ${DEPLOY_DIR_APT}/${DISTRO} \
-             --dbdir ${DEPLOY_DIR_DB}/${DISTRO} \
-             -C main \
-             includedeb ${DEBDISTRONAME} \
-             ${WORKDIR}/*.deb
+    cache_add_package ${ISAR_REPO} ${ISAR_REPO_PREFIX} ${WORKDIR}/*.deb
 }
 
 addtask deploy_deb after do_build
-- 
2.7.4


  parent reply	other threads:[~2018-02-06 10:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 10:09 [PATCH 0/6] Local apt cache with aptly Benedikt Niedermayr
2018-02-06 10:09 ` [PATCH 1/6] Implement support for setting up the local apt mirror and isar repository " Benedikt Niedermayr
2018-02-06 10:09 ` [PATCH 2/6] Added API class for apt cache Benedikt Niedermayr
2018-02-06 10:09 ` [PATCH 3/6] Added apt-cache functionality for buildchroot Benedikt Niedermayr
2018-02-06 10:09 ` [PATCH 4/6] Added apt-cache functionality for image rootfs Benedikt Niedermayr
2018-02-06 10:09 ` [PATCH 5/6] Added do_finalize_image task Benedikt Niedermayr
2018-02-06 10:09 ` Benedikt Niedermayr [this message]
2018-02-06 12:39 ` [PATCH 0/6] Local apt cache with aptly Jan Kiszka
2018-02-06 13:28   ` Jan Kiszka
2018-02-06 14:03     ` Benedikt Niedermayr
2018-02-06 14:26       ` Hombourger, Cedric
2018-02-06 13:00 ` 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=1517911779-30507-7-git-send-email-Benedikt.Niedermayr@mixed-mode.de \
    --to=benbrenson89@googlemail.com \
    --cc=Benedikt.Niedermayr@mixed-mode.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