From: Joshua Watt <jpewhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [OE-core][dunfell][PATCH v2 5/5] classes/package: Use gzip for extended package data
Date: Mon, 27 Mar 2023 15:05:30 -0500 [thread overview]
Message-ID: <20230327200530.3354151-6-JPEWhacker@gmail.com> (raw)
In-Reply-To: <20230327200530.3354151-1-JPEWhacker@gmail.com>
The master version of extended package data uses zstd for efficient
compression, but it relies on the zstd tool to be present on the host
system. Since dunfell supports older distros, we don't want to add this
tool as an additional requirement so switch to using gzip instead.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/classes/package.bbclass | 7 +++----
meta/lib/oe/packagedata.py | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 84fdafa8fe..49d30caef7 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1470,7 +1470,7 @@ PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS
python emit_pkgdata() {
from glob import glob
import json
- import bb.compress.zstd
+ import gzip
def process_postinst_on_target(pkg, mlprefix):
pkgval = d.getVar('PKG_%s' % pkg)
@@ -1610,9 +1610,8 @@ fi
sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
- subdata_extended_file = pkgdatadir + "/extended/%s.json.zstd" % pkg
- num_threads = int(d.getVar("BB_NUMBER_THREADS"))
- with bb.compress.zstd.open(subdata_extended_file, "wt", encoding="utf-8", num_threads=num_threads) as f:
+ subdata_extended_file = pkgdatadir + "/extended/%s.json.gz" % pkg
+ with gzip.open(subdata_extended_file, "wt", encoding="utf-8") as f:
json.dump(extended_data, f, sort_keys=True, separators=(",", ":"))
# Symlinks needed for rprovides lookup
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 00f7dc1f3d..feb834c0e3 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -59,12 +59,11 @@ def read_subpkgdata_dict(pkg, d):
def read_subpkgdata_extended(pkg, d):
import json
- import bb.compress.zstd
+ import gzip
- fn = d.expand("${PKGDATA_DIR}/extended/%s.json.zstd" % pkg)
+ fn = d.expand("${PKGDATA_DIR}/extended/%s.json.gz" % pkg)
try:
- num_threads = int(d.getVar("BB_NUMBER_THREADS"))
- with bb.compress.zstd.open(fn, "rt", encoding="utf-8", num_threads=num_threads) as f:
+ with gzip.open(fn, "rt", encoding="utf-8") as f:
return json.load(f)
except FileNotFoundError:
return None
--
2.33.0
prev parent reply other threads:[~2023-03-27 20:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 20:45 [OE-core][dunfell][PATCH 0/5] Backport SPDX support Joshua Watt
2023-03-22 20:45 ` [OE-core][dunfell][PATCH 1/5] classes/create-spdx: Backport Joshua Watt
2023-03-23 13:42 ` Ernst Sjöstrand
2023-03-23 20:52 ` Richard Purdie
2023-03-24 10:01 ` Ernst Sjöstrand
2023-03-22 20:45 ` [OE-core][dunfell][PATCH 2/5] classes/package: Add extended packaged data Joshua Watt
2023-03-22 20:45 ` [OE-core][dunfell][PATCH 3/5] licenses: Add GPL+ licenses to map Joshua Watt
2023-03-22 20:45 ` [OE-core][dunfell][PATCH 4/5] create-spdx: Use gzip for compression Joshua Watt
2023-03-22 20:45 ` [OE-core][dunfell][PATCH 5/5] classes/package: Use gzip for extended package data Joshua Watt
2023-03-27 20:05 ` [OE-core][dunfell][PATCH v2 0/5] Backport SPDX Support Joshua Watt
2023-03-27 20:05 ` [OE-core][dunfell][PATCH v2 1/5] classes/create-spdx: Backport Joshua Watt
2023-03-27 20:05 ` [OE-core][dunfell][PATCH v2 2/5] classes/package: Add extended packaged data Joshua Watt
2023-03-27 20:05 ` [OE-core][dunfell][PATCH v2 3/5] licenses: Add GPL+ licenses to map Joshua Watt
2023-03-27 20:05 ` [OE-core][dunfell][PATCH v2 4/5] create-spdx: Use gzip for compression Joshua Watt
2023-03-27 20:05 ` Joshua Watt [this message]
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=20230327200530.3354151-6-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/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