From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
To: <isar-users@googlegroups.com>, <jan.kiszka@siemens.com>,
<henning.schild@siemens.com>
Cc: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
Subject: [RFC PATCH 1/2] meta: Move aggregate_files to base class
Date: Mon, 29 Nov 2021 20:22:40 +0530 [thread overview]
Message-ID: <20211129145241.2932943-2-Vijaikumar_Kanagarajan@mentor.com> (raw)
In-Reply-To: <20211129145241.2932943-1-Vijaikumar_Kanagarajan@mentor.com>
This API is generic and can be used to aggregate any set of files.
This can be reused for building buildchroot preferences file in future.
Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
meta/classes/base.bbclass | 10 ++++++++++
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 ----------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 72d4cc0..6d24ca7 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -235,3 +235,13 @@ def base_set_filespath(path, d):
if p != "":
filespath.append(os.path.join(p, o))
return ":".join(filespath)
+
+def aggregate_files(d, file_list, file_out):
+ import shutil
+
+ with open(file_out, "wb") as out_fd:
+ for entry in file_list:
+ entry_real = bb.parse.resolve_file(entry, d)
+ with open(entry_real, "rb") as in_fd:
+ shutil.copyfileobj(in_fd, out_fd, 1024*1024*10)
+ out_fd.write("\n".encode())
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index e9f9291..bc8ce22 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -68,16 +68,6 @@ python () {
d.appendVar("SRC_URI", " file://%s" % bb.parse.resolve_file(file, d))
}
-def aggregate_files(d, file_list, file_out):
- import shutil
-
- with open(file_out, "wb") as out_fd:
- for entry in file_list:
- entry_real = bb.parse.resolve_file(entry, d)
- with open(entry_real, "rb") as in_fd:
- shutil.copyfileobj(in_fd, out_fd, 1024*1024*10)
- out_fd.write("\n".encode())
-
def parse_aptsources_list_line(source_list_line):
import re
--
2.25.1
next prev parent reply other threads:[~2021-11-29 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 14:52 [RFC PATCH 0/2] Buildchroot non-determinism Vijai Kumar K
2021-11-29 14:52 ` Vijai Kumar K [this message]
2021-11-29 14:52 ` [RFC PATCH 2/2] buildchroot: Add provision to specify apt preferences Vijai Kumar K
2021-11-30 16:45 ` [RFC PATCH 0/2] Buildchroot non-determinism 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=20211129145241.2932943-2-Vijaikumar_Kanagarajan@mentor.com \
--to=vijaikumar_kanagarajan@mentor.com \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@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