public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
To: <isar-users@googlegroups.com>, <ibr@radix10.net>,
	<silvano.cirujano-cuesta@siemens.com>
Cc: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
Subject: [RFC PATCH 1/2] dpkg-base: Handle custom source directory in do_apt_fetch
Date: Sat, 20 Feb 2021 01:27:18 +0530	[thread overview]
Message-ID: <20210219195719.29037-2-Vijaikumar_Kanagarajan@mentor.com> (raw)
In-Reply-To: <20210219195719.29037-1-Vijaikumar_Kanagarajan@mentor.com>

With the current do_apt_fetch implementation, it is not possible to use
a custom source directory(${S}).

apt-get source by default extracts the contents of the debian source
into folder with name <pkg>_<version>.

Add provision for specifying a custom source directory.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 meta/classes/dpkg-base.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 5c7bddc..1b94b76 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -70,7 +70,12 @@ do_apt_fetch() {
         sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
             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}"
         sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
-            sh -c 'cp /downloads/deb-src/"$1"/"$2"/* ${PP} && cd ${PP} && apt-get -y --only-source source "$2"' my_script "${DISTRO}" "${uri}"
+            sh -c ' \
+                dscfile="$(apt-get -y -qq --print-uris source "${2}" | cut -d " " -f2 | grep -E "*.dsc")"
+                cd ${PP}
+                cp /downloads/deb-src/"${1}"/"${2}"/* ${PP}
+                dpkg-source -x "${dscfile}" "${PPS}"' \
+                    my_script "${DISTRO}" "${uri}"
     done
 
     dpkg_undo_mounts
-- 
2.17.1


  reply	other threads:[~2021-02-19 19:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 19:57 [RFC PATCH 0/2] Custom base-files Vijai Kumar K
2021-02-19 19:57 ` Vijai Kumar K [this message]
2021-02-20  8:07   ` [RFC PATCH 1/2] dpkg-base: Handle custom source directory in do_apt_fetch Henning Schild
2021-02-22  7:11     ` vijai kumar
2021-03-03 12:49       ` Henning Schild
2021-03-03 13:49         ` Kanagarajan, Vijaikumar
2021-03-03 14:53           ` Henning Schild
2021-02-19 19:57 ` [RFC PATCH 2/2] recipes-core: Add recipe for base-files Vijai Kumar K
2021-02-20  8:28   ` Henning Schild
2021-02-23  8:38     ` vijai kumar
2021-02-24 12:12       ` Henning Schild
2021-02-25  3:57         ` vijai kumar
2021-02-25  5:08           ` vijaikumar....@gmail.com
2021-02-25  8:20             ` Jan Kiszka
2021-02-25  8:40               ` Jan Kiszka
2021-02-25  9:06               ` vijaikumar....@gmail.com
2021-02-25 16:32                 ` Henning Schild
2021-03-01  5:07                   ` vijaikumar....@gmail.com
2021-03-01  7:35                     ` Henning Schild
2021-03-01  8:04                       ` vijaikumar....@gmail.com
2021-02-25  8:10           ` Henning Schild
2021-02-25  8:26             ` vijaikumar....@gmail.com
2021-02-22 12:39   ` Anton Mikanovich
2021-02-23  8:41     ` vijaikumar....@gmail.com
2021-02-24  9:20       ` vijaikumar....@gmail.com
2021-02-24  9:21         ` Jan Kiszka
2021-02-24 11:40           ` vijaikumar....@gmail.com
2021-02-24 11:54             ` 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=20210219195719.29037-2-Vijaikumar_Kanagarajan@mentor.com \
    --to=vijaikumar_kanagarajan@mentor.com \
    --cc=ibr@radix10.net \
    --cc=isar-users@googlegroups.com \
    --cc=silvano.cirujano-cuesta@siemens.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