From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 07 Oct 2025 21:15:16 +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 1v6D9Y-005Ljd-07 for lore@lore.pengutronix.de; Tue, 07 Oct 2025 21:15:16 +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 1v6D9X-0003I9-No; Tue, 07 Oct 2025 21:15:15 +0200 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1v6D9I-0003H7-Hh for ptxdist@pengutronix.de; Tue, 07 Oct 2025 21:15:01 +0200 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-62fc0b7bf62so10200206a12.2 for ; Tue, 07 Oct 2025 12:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759864500; x=1760469300; 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=ZEkG4V2YxoZ4vNnhUH9he2QX2ZOe/NfhxdQpF6BRtF8=; b=XlNS6CFs3dKQ8cgapEAyJLoqa6BEqM6XhnSKXlfVPx9swy4wVCDYFI1cLXfZ9KdmPZ Ztdnm5xcjlGTd+uwJpdkwN++JKyVAijiGB3P7hLwNgXVYZ7p+zC0iZhachVN1uF96iRg kDgOKeJ4kBlirG74cGSuLbVtrSVbqF83iOLfupx/QN9SYLwi1R9ZxruDWNz5rngEp426 KGSKRr1YXfblF1gNSWvcIlyacRrNjg0kI04+YjaeKa9Ii+QYuadL6Wpnl0rreDKPlJxW WE2tAFi2ITNz0euxF6Gc+7sZ1qEX/3l0GLi26g/k5lnpEur7aL+FYmusbdJJK1gamnQT Yxlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759864500; x=1760469300; 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=ZEkG4V2YxoZ4vNnhUH9he2QX2ZOe/NfhxdQpF6BRtF8=; b=Mvb4mhQhCLzY0I3HlDYOMP+T+4RPFhfa9c5FkW81Mq+skBBY4yPrJ74zTG/YE9noEE FJEGmg0FvfeP4EMbMMVP4zQ64RYDM3N51PYoIhbiZVvNjiOYUympSwd9Tr8P6b1VR//V 9a0KTCCv0xj4SO+4NK9wOqHLE0b8mBB6fPWZ6YIuBOFPLCyWY934be9oNs1QzqRpf2uL VmQ853ZGu1j6EKwnz5ysC1d/xScXsZvGL8UfYrAUynH+agMCSCm+wsoHGZrTaLLY7Nem MrJ9pUulskDxmXWPEWjSvLROwzGOO9yHueeqDOGjIGztV4tWo3gGu0b5EJf7uHy0eLHz Z42Q== X-Gm-Message-State: AOJu0Ywpvbeglxy2Hta41PdoCRV7GdWjTkmWbm58fnBGQfg+C7UKb0NT cMJRtZdkXmq0o6BovUI10iF2wqt4tx6ufOjPjIlxvmXkvHlHB7u7w9si+wtf4Q== X-Gm-Gg: ASbGnct8VmNclBcrxnZVENVNRLE0bmikA662Z/3dOfeou9mD6PIYUBNxY1q2qFR3L1x UvBJMxz//3PIPu/edgN63oPnCyZvK/GtjhxcBiaPIaTNLSsBlQ0waYy4nN5o58u0MvREV0qILFz +WcRLvSpPKUT4SUIYKEJyNsVXav5ry4y0CEdUcDpuOCu9iFVbzdkI9pOUJRwWcb41HHe82VN8tx iP9smx0uxsnIV4XDpH4Eup9h020Z3ZXrhsayHiduXjF8DqkdYE7rgQD+MS00qWnM5jCEJuGoefO elk9V5vSJOxMr854CYpi/UgpG/9IBbiO2nE2+P32xtVL2al4U2wYmWKhcJZ+9vQZssqnjTejGDM uTeBsB2npMfpTiYaex8m1VIIk4iXH0BFC2shyH/8eOKF2jkIjQ31EQbPN0OpHJqZ3KbgzTnuYTq cbphcTh6spQpPDdMGAsZeGngZpbjgi X-Google-Smtp-Source: AGHT+IFfssVOEnpYM5hQRE42O/QOZ4yaJKlyRGP4oPE4OEtsskjBlVHRmcpDTimRgfuSleQ9eo7ctA== X-Received: by 2002:a17:907:971b:b0:afe:d590:b6af with SMTP id a640c23a62f3a-b50aaa96bb0mr93677066b.20.1759864499335; Tue, 07 Oct 2025 12:14:59 -0700 (PDT) Received: from fedora.tux.internal (85.191.71.118.dynamic.dhcp.aura-net.dk. [85.191.71.118]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b48652a9f5dsm1434549366b.11.2025.10.07.12.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Oct 2025 12:14:58 -0700 (PDT) From: Bruno Thomsen To: ptxdist@pengutronix.de Date: Tue, 7 Oct 2025 21:14:46 +0200 Message-ID: <20251007191446.12149-1-bruno.thomsen@gmail.com> X-Mailer: git-send-email 2.51.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] [PATCH v3] ptxdist: add repology json output support 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, Roland Hieber , Ladislav Michl 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 Improve ptxdist project visibility by adding it to repology. https://repology.org/ This also allows components like rauc to showcase supported distributions and current packaged version. It also gives ptxdist users and maintainers an overview of packages with known CVEs that should be priotized for version bumpes. Generate JSON output about almost all packages in ptxdist for repology. Below is an output example for alsa-lib: { "name": "alsa-lib", "version": "1.2.13", "upstream_urls": "https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.13.tar.bz2", "license": "LGPL-2.1-or-later" }, Add PTXdist support #1487: https://github.com/repology/repology-updater/issues/1487 This have been running for the past few months here: https://github.com/baxeno/ptxdist-repology/blob/main/repology.json Using the following command with DistroKit: $ ptxdist repology > repology.json Signed-off-by: Bruno Thomsen Co-developed-by: Ladislav Michl Co-developed-by: Roland Hieber --- v2-v3: - Clean JSON output without 'grep -v', thanks to Roland. v1-v2: - Keep Makefile implementation as Python implementation did not work - Filter out packages with empty URL - Filter out packages with empty or undefined version - Reduced number of hard-coded ignored packages from 33 to 2 - View parsed output: https://repology.org/repository/ptxdist PATCH v2: https://lore.ptxdist.org/ptxdist/1759743993-018f2348c8b6069223089c68@pty/T/#mbdc9ce0a6541d0dce31a00a94ffb472c22410880 PATCH v1: https://lore.ptxdist.org/ptxdist/20250422193456.26040-1-bruno.thomsen@gmail.com/ PATCH RFC: https://lore.ptxdist.org/ptxdist/20250418113357.23654-1-bruno.thomsen@gmail.com/ bin/ptxdist | 6 ++++ rules/post/ptxd_make_repology.make | 50 ++++++++++++++++++++++++++++++ scripts/bash_completion | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 rules/post/ptxd_make_repology.make diff --git a/bin/ptxdist b/bin/ptxdist index 0e7af6142..868eb17b3 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. @@ -1925,6 +1926,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..3b8793d4d --- /dev/null +++ b/rules/post/ptxd_make_repology.make @@ -0,0 +1,50 @@ +# -*-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. +# + +PTX_PACKAGES_IGNORE := \ + cross-llvm \ + nodejs_packages + +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) "upstream_urls": "$($(PTX_MAP_TO_PACKAGE_$(1))_URL)"$(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 = \ + $(info [) \ + $(foreach pkg,$(ptx_packages_reported), \ + $(if $(subst undefined,,$($(PTX_MAP_TO_PACKAGE_$(pkg))_VERSION)), \ + $(if $($(PTX_MAP_TO_PACKAGE_$(pkg))_URL), \ + $(call ptx/repology-item,$(pkg))$(ptx/nl),),)) \ + $(call ptx/repology-lastitem,$(ptx_package_last)) \ + $(info ]) + +ptxdist-repology: + @$(call ptx/repology) + @touch $(PTXDIST_TEMPDIR)/repology.done + +# 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) base-commit: de3afe806e398349482e92e812f6f69467070ec4 -- 2.51.0