On Sun, Apr 20, 2025 at 06:18:32PM +0200, Bruno Thomsen wrote:
> Hi
> 
> I also started with ptxdist-lint but might have removed a little too
> much of the makefile
> and relied too much on the bash script part :)
> It would be nice if we could run more makefile to get dynamic versions
> and licenses resolved
> before handoff to bash script. Or maybe we should do it more like spdx
> sbom in Python.
> 
> The sorting and indentation is currently done externally by jq, but
> that could be moved inside
> ptxd_make_world_repology script function.
> 
> Also I am a bit unsure if this cross rule variable access is actually
> more of a bug then a feature.
> 
> $ rg XORG_LIB_X11_LICENSE
> rules/libx11-locale.make
> 24:LIBX11_LOCALE_LICENSE    = $(XORG_LIB_X11_LICENSE)
> 
> rules/xorg-lib-X11.make
> 24:XORG_LIB_X11_LICENSE    := MIT

I guess we are overcomplicating it. What about simply (working concept):
$ cat scripts/lib/ptxd_make_world_repology.sh 

PTX_PACKAGES_TARGET := \
        $(sort $(filter-out host-system-%,$(filter-out host-%,$(filter-out 
image-%,$(PTX_PACKAGES_ALL)))))

PHONY += ptxdist-repology

ptx/repology = \
        @$(foreach pkg,$(PTX_PACKAGES_TARGET), \
                echo "{\"name\": \"${pkg}\", \"version\": 
\"$($(PTX_MAP_TO_PACKAGE_$(pkg))_VERSION)\", \"license\": 
\"$($(PTX_MAP_TO_PACKAGE_$(pkg))_LICENSE)\"}"$(ptx/nl))

ptxdist-repology:
        @$(call targetinfo)
        @$(call ptx/repology)

# vim: syntax=make
EOF

Doing all inside makefile quite simplifies it and performance is
probably not critical here.

> Ladislav you can find latest development version of this repology support 
> here:
> https://github.com/baxeno/ptxdist/tree/repology_support
> (you can send PR directly if you wish)

I'll try to cook up something but not sooner than next week.

        l.

Reply via email to