From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 26 Apr 2025 18:24:10 +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 1u8iK2-005cVC-2S for lore@lore.pengutronix.de; Sat, 26 Apr 2025 18:24:10 +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 1u8iK2-000644-E8; Sat, 26 Apr 2025 18:24:10 +0200 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1u8iJl-00063r-Eq; Sat, 26 Apr 2025 18:23:54 +0200 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-e732fa4e2f1so238120276.0; Sat, 26 Apr 2025 09:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745684632; x=1746289432; darn=pengutronix.de; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DQSMxzsXrBpj6h4QlMoSiWixoiCdlA4buUFQnvwkG3U=; b=MLqw2nG3aJK4h/RVV33XnwvywuNMB40Y80/wqFwtjHxZJW3cGUCIuk98Vp5OWJ/Dct N0id1miRvgnHBrVxk18xugHvjg6OlvQzSwylvjPl5/I4T0lpce1FQJrHXjHpCl5bRoCI rDqXktMl2N51LdeJlg59QcDkQqWvaoYI4BYKG8h+PWd22r2H7ehv4AB50DKK4WIPYBTd XN4LUjZXud8crnYHGJMJVUxYyon1M2iatmD/I9NS127eW2lE53WNjs2egKGlanHiSalk TPE4hGMvDAD3W2pAp0HDjX6zRgP2IVVNMifR/neGPXU+UK4v/lpOWi6AthehvVA2LOHd wk4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745684632; x=1746289432; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DQSMxzsXrBpj6h4QlMoSiWixoiCdlA4buUFQnvwkG3U=; b=DR6PWINjIRYrRJ/rynrM1OFCFm00CPktpHhNVfWHGglmIybR5uYPwE7vzszvL2MFf5 e4Z+jSK0AXhEAWW/aDAmzD9vNA6ApBxtY1gbj3mkoE5Z5vIJPbxRnb2WNOdhFyGRtlhq Zam3I2rAMYwP0FCvi2gKZ8xvJBQfOFpv9Uk4leLOqvxJDXFNoa+v973fNoi8x+jYoRvS 2Pnbo7twL6ASKK5InYhKZD94rjvdJRL07VTpiO9C/xVtad6WmvuUnwXb+NShwGTUW5mV 6nhdvj+2roxnwhbSalYc6K5Gt2PiyEXv/NnCdKX9wqr9zqhD1KdyTan0PPmyZHppH3fq ynJw== X-Gm-Message-State: AOJu0YyM7ql29UoyMXFcDQ+aEzg6dsyErC4ftSk5BgEBdpqstEJYaYb+ iDq18PBwvA2PUSFUAvF3I/lzX80v8sB7Ar1AMdUS0CM48yFLoxNaLIkvdoS+vIbuoCDV2DyWMr6 WaH5S49nZSJQ7yf39u5qZdTZJ0F/EEA== X-Gm-Gg: ASbGncvU0T/yZ6sJeYgLLrj+ecEJFZSvmZGMQhit2t6+7t9KBQTCQbkV/y97EPW7yQy EvdyUqE4FqWui+ga9a0h92qkLMzgXJWW/MJZ3CT0Kswp9Xj2yRdSbArRF3EVnCPs5uri1qkgxSw yeu+/UCVxqBmwlPLbE540+OA== X-Google-Smtp-Source: AGHT+IFPUjCXu87C/eoYPpygcRd8jZmMG25nsWEvhSpq8OdyYdfJXUGxfbYM64r7wHHYPs+kWqppAreL8zDts0fXVrs= X-Received: by 2002:a05:690c:b12:b0:6fb:3b2b:e73e with SMTP id 00721157ae682-708540f85f3mr87478707b3.14.1745684631758; Sat, 26 Apr 2025 09:23:51 -0700 (PDT) MIME-Version: 1.0 References: <20250418113357.23654-1-bruno.thomsen@gmail.com> In-Reply-To: From: Bruno Thomsen Date: Sat, 26 Apr 2025 18:23:35 +0200 X-Gm-Features: ATxdqUGUEIDk-dYvWaL1v4-NUS8xtWgIWOWnU-0oWRa8aIrxQmoDTaYgsbwrIJI Message-ID: To: Michael Olbrich Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.6 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: ptxdist@pengutronix.de 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 Den l=C3=B8r. 26. apr. 2025 kl. 12.13 skrev Michael Olbrich : > > On Fri, Apr 18, 2025 at 01:33:57PM +0200, Bruno Thomsen wrote: > > Improve ptxdist project visibility by adding it to repology. > > > > 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. > > Hmm, I think it makes more sense to add this to the report stuff in > scripts/report/. That should be a pretty simple python script. > You can still add a command and make target to call this but there is no > need for manual parsing. Welcome back :) There is a newer patch version that removes the bash script and does it all in makefile. Maybe it should be converted to a python script. This "report" is a bit different since it includes all ptxdist packages and not just the packages used in a project. /Bruno > > Michael > > > > > 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 v= ariable > > licensecheck check md5sums of license files fo= r 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 pack= ages > > 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 condit= ions > > +# see the README file. > > +# > > + > > +PHONY +=3D ptxdist-repology > > + > > +ptx/repology =3D \ > > + $(call ptx/env) \ > > + ptx_dgen_rulesfiles_make=3D"$(PTX_DGEN_RULESFILES_MAKE)" \ > > + ptxd_make_world_repology > > + > > +ptxdist-repology: > > + @$(call targetinfo) > > + @$(call ptx/repology) > > + > > +# vim: syntax=3Dmake > > 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=3D( $( compgen -W root -- $cur ) ) > > ;& > > - get|extract|prepare|compile|install|targetinstall|tags|urlcheck|l= icensecheck|package-info|cargosync) > > + get|extract|prepare|compile|install|targetinstall|tags|urlcheck|l= icensecheck|repology|package-info|cargosync) > > COMPREPLY+=3D( $( compgen -W "$(__ptxdist_completion_pack= ages)" -- $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 condit= ions > > +# see the README file. > > +# > > + > > +ptxd_make_world_repology() { > > + local filefd file > > + local first > > + ptxd_make_world_init > > + > > + echo "Locating all target packages ..." > > + > > + first=3D1 > > + exec {filefd}< <(ptxd_make_world_lint_makefiles) > > + while read file <&${filefd}; do > > + filename=3D"${file##*/}" > > + > > + case "${filename}" in > > + host-system-*|host-*|cross-*|image-*) > > + continue > > + ;; > > + *) > > + ;; > > + esac > > + case "${file}" in > > + */rules/post/*|*/rules/pre/*) > > + continue > > + ;; > > + *) > > + ;; > > + esac > > + grep -q '^[^ ]*_VERSION[ :]*=3D' "${file}" || continue > > + > > + pkg_name=3D$(grep '^PACKAGES-$(PTXCONF_' "${file}" | cut -d '=3D'= -f 2 | xargs) > > + pkg_version=3D$(grep '^[^ ]*_VERSION[ :]*=3D' "${file= }" | cut -d '=3D' -f 2 | xargs) > > + pkg_license=3D$(grep '^[^ ]*_LICENSE[ :]*=3D' "${file= }" | cut -d '=3D' -f 2 | xargs) > > + > > + [[ "$pkg_license" =3D=3D *"call remove_quotes"* ]] && continue > > + [[ "$pkg_version" =3D=3D *"call ptx/"* ]] && continue > > + > > + if [ $first -eq 1 ]; then > > + first=3D0 > > + 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 > > > > > > > > -- > Pengutronix e.K. | = | > Steuerwalder Str. 21 | http://www.pengutronix.de/ = | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 = |