From: Ladislav Michl <oss-lists@triops.cz>
To: ptxdist@pengutronix.de
Cc: Bruno Thomsen <bruno.thomsen@gmail.com>
Subject: Re: [ptxdist] [RFC PATCH] ptxdist: add repology sub command
Date: Mon, 21 Apr 2025 17:51:25 +0200 [thread overview]
Message-ID: <aAZpfe_Ytd7xfwfu@lenoch> (raw)
In-Reply-To: <aAVEKYHQy3Mw7yj9@lenoch>
On Sun, Apr 20, 2025 at 08:59:53PM +0200, Ladislav Michl wrote:
> Doing all inside makefile quite simplifies it and performance is
> probably not critical here.
echo in a subshell is the bottleneck. Here's complete version as a patch
on the top of original one (there are more packages to ignore, which is
left as an excercise for the reader):
diff --git a/rules/post/ptxd_make_repology.make b/rules/post/ptxd_make_repology.make
index b243ed03e..0083ded34 100644
--- a/rules/post/ptxd_make_repology.make
+++ b/rules/post/ptxd_make_repology.make
@@ -6,15 +6,40 @@
# see the README file.
#
+PTX_PACKAGES_IGNORE := \
+ base \
+ cryptodev-api
+
PHONY += ptxdist-repology
+ptx_packages_reported:=$(sort $(filter-out host-system-%,$(filter-out host-%,$(filter-out image-%,$(PTX_PACKAGES_ALL)))))
+ptx_packages_reported:=$(filter-out $(PTX_PACKAGES_IGNORE),$(ptx_packages_reported))
+ptx_package_last:=$(lastword $(ptx_packages_reported))
+ptx_packages_reported:=$(filter-out $(ptx_package_last),$(ptx_packages_reported))
+
+ptx/repology-print = \
+ $(info $(space) "name": "$(1)"$(comma)) \
+ $(info $(space) "version": "$($(PTX_MAP_TO_PACKAGE_$(1))_VERSION)"$(comma)) \
+ $(info $(space) "license": "$($(PTX_MAP_TO_PACKAGE_$(1))_LICENSE)")
+
+ptx/repology-item = \
+ $(info $(space) {) \
+ $(call ptx/repology-print,$(1)) \
+ $(info $(space) }$(comma))
+
+ptx/repology-lastitem = \
+ $(info $(space) {) \
+ $(call ptx/repology-print,$(1)) \
+ $(info $(space) })
+
ptx/repology = \
- $(call ptx/env) \
- ptx_dgen_rulesfiles_make="$(PTX_DGEN_RULESFILES_MAKE)" \
- ptxd_make_world_repology
+ $(info [) \
+ $(foreach pkg,$(ptx_packages_reported), \
+ $(call ptx/repology-item,$(pkg))$(ptx/nl)) \
+ $(call ptx/repology-lastitem,$(ptx_package_last)) \
+ $(info ])
ptxdist-repology:
- @$(call targetinfo)
@$(call ptx/repology)
# vim: syntax=make
next prev parent reply other threads:[~2025-04-21 15:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 11:33 Bruno Thomsen
2025-04-19 21:10 ` Ladislav Michl
2025-04-20 8:41 ` Ladislav Michl
2025-04-20 16:18 ` Bruno Thomsen
2025-04-20 18:59 ` Ladislav Michl
2025-04-21 15:51 ` Ladislav Michl [this message]
2025-04-26 10:13 ` Michael Olbrich
2025-04-26 16:23 ` Bruno Thomsen
2025-04-27 14:58 ` Michael Olbrich
2025-04-28 6:24 ` Ladislav Michl
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=aAZpfe_Ytd7xfwfu@lenoch \
--to=oss-lists@triops.cz \
--cc=bruno.thomsen@gmail.com \
--cc=ptxdist@pengutronix.de \
/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