From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 19 Apr 2025 23:11:19 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u6FT5-002uJD-0x for lore@lore.pengutronix.de; Sat, 19 Apr 2025 23:11:19 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1u6FT4-0003yx-T4; Sat, 19 Apr 2025 23:11:18 +0200 Received: from h1.cmg2.smtp.forpsi.com ([81.2.195.188]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u6FSc-0003yH-C9 for ptxdist@pengutronix.de; Sat, 19 Apr 2025 23:10:51 +0200 Received: from lenoch ([91.218.190.200]) by cmgsmtp with ESMTPSA id 6FSZuN3MpMnq76FSbuNh1L; Sat, 19 Apr 2025 23:10:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1745097049; bh=226kL8hftrWtnUT4TojZelvr5o+4mhAZ0aonjwOwduA=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=voYikMA3WFRPs4MERpNWfv3fi4u+h+7gMe0gM9eF/fgFNywLcQUEc2D9MLqYfnHbT +DjcvkdCEN9iPXI65NQi4fk16555lYdiBtkC12Z5j8xVmwZOHqgx0nr75t1luu8czd InoxfQqVoYtje8eL1/gbwUbhHMBHSo6ahMnJLYmoinU3IdHzOP7obcbiNPMDs/ROW9 HwdFdJWqEuVwp7qIwd325f7FhvQzdI9gVe/hwWKgvaV2utOEJY+RUky0jCUzxujSDY /69ENq+Tmy+TWS+yD8UIc/gZ3eDCRQ7mIVAld3xS1H8JJvqa9kaJFYsi/1hVj9OSL1 ISz57GvFdy0CQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1745097049; bh=226kL8hftrWtnUT4TojZelvr5o+4mhAZ0aonjwOwduA=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=voYikMA3WFRPs4MERpNWfv3fi4u+h+7gMe0gM9eF/fgFNywLcQUEc2D9MLqYfnHbT +DjcvkdCEN9iPXI65NQi4fk16555lYdiBtkC12Z5j8xVmwZOHqgx0nr75t1luu8czd InoxfQqVoYtje8eL1/gbwUbhHMBHSo6ahMnJLYmoinU3IdHzOP7obcbiNPMDs/ROW9 HwdFdJWqEuVwp7qIwd325f7FhvQzdI9gVe/hwWKgvaV2utOEJY+RUky0jCUzxujSDY /69ENq+Tmy+TWS+yD8UIc/gZ3eDCRQ7mIVAld3xS1H8JJvqa9kaJFYsi/1hVj9OSL1 ISz57GvFdy0CQ== Date: Sat, 19 Apr 2025 23:10:47 +0200 From: Ladislav Michl To: ptxdist@pengutronix.de Message-ID: References: <20250418113357.23654-1-bruno.thomsen@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250418113357.23654-1-bruno.thomsen@gmail.com> X-CMAE-Envelope: MS4xfFBpqaIg9586NuGespiakkj0vBPL1pywhC6cfph3yuaJvQA5wLsZnoRD95/5MQqp40O8a1QZaU/yOj6oh5en2hZ36IC+zZRKsDcZHl+elpz4/PAtXus0 8cF+LBb1RlIh07k3Y5OSpEs9LAO08areQOMeM5o3g7mvOIs4UPhWX46P3Ivr6WIOBmaABoX3cZcS2L/JEjWBW9G/TGa1UG3vF5C16dHP1g8yQBoia/FfFDmw X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [RFC PATCH] ptxdist: add repology sub command X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: bruno.thomsen@gmail.com Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Hello Bruno, On Fri, Apr 18, 2025 at 01:33:57PM +0200, Bruno Thomsen wrote: > Improve ptxdist project visibility by adding it to repology. This is just cool :) A little remark bellow... > Generate JSON output about all packages in ptxdist for repology. > > ptxdist repology | tail -n +7 | jq > > This is just a POC for integrating ptxdist with repology. > > Add PTXdist support #1487: > https://github.com/repology/repology-updater/issues/1487 > > I have run this patch against ptxdist-2024.12.0 and got this output: > https://github.com/baxeno/ptxdist-repology/blob/main/repology.json > > Signed-off-by: Bruno Thomsen > --- > Any feedback is welcome as this is a very rough implementation. > > bin/ptxdist | 6 +++ > rules/post/ptxd_make_repology.make | 20 +++++++++ > scripts/bash_completion | 2 +- > scripts/lib/ptxd_make_world_repology.sh | 54 +++++++++++++++++++++++++ > 4 files changed, 81 insertions(+), 1 deletion(-) > create mode 100644 rules/post/ptxd_make_repology.make > create mode 100644 scripts/lib/ptxd_make_world_repology.sh > > diff --git a/bin/ptxdist b/bin/ptxdist > index 1f561fdf6..24a8e2ed9 100755 > --- a/bin/ptxdist > +++ b/bin/ptxdist > @@ -799,6 +799,7 @@ Misc: > variable and print the contents of this variable > licensecheck check md5sums of license files for all packages > lint run some basic checks for the bsp and PTXdist > + repology generate repology JSON for PTXdist > list-packages print a list of all selected packages > local-src [] overwrite a package source with a locally provided > directory containing the sourcecode. > @@ -1916,6 +1917,11 @@ EOF > ptxd_bailout "lint checks failed" > fi > ;; > + repology) > + check_premake_compiler && > + ptxd_make_log ptxdist-repology > + exit > + ;; > list-packages) > check_config && > check_deps && > diff --git a/rules/post/ptxd_make_repology.make b/rules/post/ptxd_make_repology.make > new file mode 100644 > index 000000000..b243ed03e > --- /dev/null > +++ b/rules/post/ptxd_make_repology.make > @@ -0,0 +1,20 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2025 by Bruno Thomsen > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +PHONY += ptxdist-repology > + > +ptx/repology = \ > + $(call ptx/env) \ > + ptx_dgen_rulesfiles_make="$(PTX_DGEN_RULESFILES_MAKE)" \ > + ptxd_make_world_repology Here would be probably better to pass $(PTX_PACKAGES_INSTALL) and possibly sort it. > +ptxdist-repology: > + @$(call targetinfo) > + @$(call ptx/repology) > + > +# vim: syntax=make > diff --git a/scripts/bash_completion b/scripts/bash_completion > index 4bff2d4b6..2bb21a848 100644 > --- a/scripts/bash_completion > +++ b/scripts/bash_completion > @@ -123,7 +123,7 @@ _ptxdist_completion() > clean) > COMPREPLY=( $( compgen -W root -- $cur ) ) > ;& > - get|extract|prepare|compile|install|targetinstall|tags|urlcheck|licensecheck|package-info|cargosync) > + get|extract|prepare|compile|install|targetinstall|tags|urlcheck|licensecheck|repology|package-info|cargosync) > COMPREPLY+=( $( compgen -W "$(__ptxdist_completion_packages)" -- $cur ) ) > ;; > drop) > diff --git a/scripts/lib/ptxd_make_world_repology.sh b/scripts/lib/ptxd_make_world_repology.sh > new file mode 100644 > index 000000000..2b3a0a098 > --- /dev/null > +++ b/scripts/lib/ptxd_make_world_repology.sh > @@ -0,0 +1,54 @@ > +#!/bin/bash > +# > +# Copyright (C) 2025 by Bruno Thomsen > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +ptxd_make_world_repology() { > + local filefd file > + local first > + ptxd_make_world_init > + > + echo "Locating all target packages ..." > + > + first=1 > + exec {filefd}< <(ptxd_make_world_lint_makefiles) > + while read file <&${filefd}; do > + filename="${file##*/}" > + > + case "${filename}" in > + host-system-*|host-*|cross-*|image-*) > + continue > + ;; > + *) > + ;; > + esac > + case "${file}" in > + */rules/post/*|*/rules/pre/*) > + continue > + ;; > + *) > + ;; > + esac > + grep -q '^[^ ]*_VERSION[ :]*=' "${file}" || continue > + > + pkg_name=$(grep '^PACKAGES-$(PTXCONF_' "${file}" | cut -d '=' -f 2 | xargs) > + pkg_version=$(grep '^[^ ]*_VERSION[ :]*=' "${file}" | cut -d '=' -f 2 | xargs) > + pkg_license=$(grep '^[^ ]*_LICENSE[ :]*=' "${file}" | cut -d '=' -f 2 | xargs) ...and here use that list as this loop fails for valgring, which lists: PACKAGES-$(PTXCONF_ARCH_X86)-$(PTXCONF_VALGRIND) += valgrind PACKAGES-$(PTXCONF_ARCH_PPC)-$(PTXCONF_VALGRIND) += valgrind PACKAGES-$(PTXCONF_ARCH_ARM)-$(PTXCONF_VALGRIND) += valgrind PACKAGES-$(PTXCONF_ARCH_ARM64)-$(PTXCONF_VALGRIND) += valgrind > + [[ "$pkg_license" == *"call remove_quotes"* ]] && continue > + [[ "$pkg_version" == *"call ptx/"* ]] && continue > + > + if [ $first -eq 1 ]; then > + first=0 > + echo "[" > + else > + echo "," > + fi > + echo "{\"name\": \"${pkg_name}\", \"version\": \"${pkg_version}\", \"license\": \"${pkg_license}\"}" > + done > + echo "]" > +} > +export -f ptxd_make_world_repology > > base-commit: f61905c23240642dec3e5390ee15e83cf1e016e9 > -- > 2.49.0 >