From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 13 Jun 2025 20:47:43 +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 1uQ9RH-006zFc-1f for lore@lore.pengutronix.de; Fri, 13 Jun 2025 20:47:43 +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 1uQ9RH-0001CI-7V; Fri, 13 Jun 2025 20:47:43 +0200 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1uQ9R1-0001C9-Bs for ptxdist@pengutronix.de; Fri, 13 Jun 2025 20:47:27 +0200 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-adf3b33f968so110094066b.0 for ; Fri, 13 Jun 2025 11:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749840445; x=1750445245; darn=pengutronix.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Yvjz7Z7eS8POduCaSsPhA4LaDFzCT9z691TxEwFCqRw=; b=BEK3AuyhpoqQgQXtQargFCRlUDgtQBhxCwWH6L8tLB2NJjseBy8j1YPv7y2RBmUUl9 g20uzrpz6ZRPnAft1rIAQgGDNR2Mk4MZWA5wJAz+udoJ8GXlY2Z8Cm4AU3AR+NKizozv aH1dq3l3vbmnAkVhChd1KJEocsEJ75k/UM2R9s+JxfJ/czJlNGx8Kq1R2cWVnu2Of0qC mlK8xICmX3D1QrSMKwBO2mk4k3xoAFO84baz8a5/EkrIiA/aFSDrVZw+TyqqSydnzKBh OPcRiYbw0S/w2HJi5Yc3KF5YPOJ8bwdoY5q00hyykf8c4h+MDnzKpNum30o5VrbqmUIV v6Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749840445; x=1750445245; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Yvjz7Z7eS8POduCaSsPhA4LaDFzCT9z691TxEwFCqRw=; b=NoIfdG7t1FhgrGm6Kw9SXkuRe1cPIk9FqPeU+vWrGoJvg8zGUHgoEa8rP+Q5JFamE2 47rknRN6dZWgPn1qomOpWNx4dU0vsqzVCSDIKqKsV3lOTrAeCM4V4tZ2YicoZiiPGlks RQQfgJfo9UsVn4aD2UwLrBsoEKK8HIVmxOtisHBXFST6w+Qu3DH7hbdgITtOTp04e9cl Lz2o4y6uYJCt0lEuVhhOXAMeeBOiuOL8SgiAyeL3MKqzKBUJSRka/QUIqAVcRP4K1IoI KmnCKnFhtH8stLO0a+VI6n0orpIfUJczaSzxID7IgzYkQH9cBJjCn7pgwvUAyZXM1UXL Vz5w== X-Gm-Message-State: AOJu0Yx5jb65rjhRCUNzK70CX7vMrrb0BQC32OawNqv1THezbs+Ps9tv sZVwg/8pvSBw888a83eZTAobGpE3rM9Xn7k2ByaCSiYqFgRUQHwylfNB0SWZhg== X-Gm-Gg: ASbGncugw1t7m1ipkDVqZ8nrEWf/NySuHm+uQ3ZCaLd2LWo3zwM6jnccjK8UClIoPlb FJ5FotUzDW8f79clApKEfEzXHJQdauITDS9bn+WQaspL99T3XljMYjYnAqV5Nwtc8JAEV4bQElZ Vd1CzoPphW/AL0mAXNd81HX6C9WV/+rOPwX8OuXWzeyefIov0NUSM9mPaD0Jen/Nsyg21vuAsVr LoMs9IIMhuvz1ZT9P3AFYUSgzi+QC4+Y1KMstXHImWlRxKzoWV03PHhMucJlZ+/8Nt8Nyd5Kiqa DuFVuQsQaHFXFFcQe497AdpyHgKN0pGA/lL97P7/IKuU7+Mea5MfLn2EPfzKpkAqNU6U9n6lMbn 9yslJF12cPr3/BC6CTU6TFt6YiUDeF9cUmC3KgGAMvyc= X-Google-Smtp-Source: AGHT+IFW8G/qj6XsHyWHoV7jJ1h+vmYN6aQIlfDKd5FJfd2yDPVCLJc4OA+s6VpbBYEQKL/IPvVL0g== X-Received: by 2002:a17:907:940f:b0:ad2:2fdb:b0ab with SMTP id a640c23a62f3a-adf9fc806b3mr75972766b.29.1749840445176; Fri, 13 Jun 2025 11:47:25 -0700 (PDT) Received: from fedora.tux.internal (85.191.78.244.dynamic.dhcp.aura-net.dk. [85.191.78.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-adec892b90csm169154166b.142.2025.06.13.11.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jun 2025 11:47:24 -0700 (PDT) From: Bruno Thomsen To: ptxdist@pengutronix.de Date: Fri, 13 Jun 2025 20:47:22 +0200 Message-ID: <20250613184722.24787-1-bruno.thomsen@gmail.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.1 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: [ptxdist] [RFC PATCH] repology: python WIP 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 'ptxdist-repology' must depend on 'host-system-python3' for 'python3'! Signed-off-by: Bruno Thomsen --- I'm stuck in converting repology command from Bash/Makefile to Bash/Python as it needs to depend on host-system-python3 but I simply do not know how to do that. So any pointers would be helpful. bin/ptxdist | 6 ++++++ rules/post/ptxd_make_repology.make | 21 +++++++++++++++++++++ scripts/bash_completion | 2 +- scripts/report/repology.py | 25 +++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 rules/post/ptxd_make_repology.make create mode 100755 scripts/report/repology.py diff --git a/bin/ptxdist b/bin/ptxdist index 66b46c6da..64a1cb9f7 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..3fad8e248 --- /dev/null +++ b/rules/post/ptxd_make_repology.make @@ -0,0 +1,21 @@ +# -*-makefile-*- +# +# Copyright (C) 2025 by Bruno Thomsen +# 2025 by Ladislav Michl +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +PHONY += ptxdist-repology + +# Use '=' to delay $(shell ...) calls until this is needed +PTX_REPOLOGY_PY = $(call ptx/in-path, PTXDIST_PATH_SCRIPTS, report/repology.py) + +ptx/repology = \ + @$(call world/execute, PTX_REPOLOGY, $(PTX_REPOLOGY_PY)) + +ptxdist-repology: + @$(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/report/repology.py b/scripts/report/repology.py new file mode 100755 index 000000000..5e9d562cd --- /dev/null +++ b/scripts/report/repology.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2025 by Bruno Thomsen +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +from os import environ + +from report.report import ReportException + + +def main(): + print("Repology script") + print(environ) + exit(0) + +if __name__ == "__main__": + try: + main() + except ReportException as e: + print(f'Repology report failed: {e.args[0]}') + exit(1) + -- 2.49.0