summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create_go.py
Commit message (Collapse)AuthorAgeFilesLines
* recipetool/create_go: proxy module fetching to go-mod-update-modulesRoss Burton16 hours1-116/+36
| | | | | | | | | | Now that the go-mod-update-modules class exists, this Go handler can create a stub recipe and then proxy the module handling to the class. (From OE-Core rev: 0aa406d0582d32399c48dfa78f24adc75696112c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create_go: Use gomod fetcher instead of go mod vendorChristian Lindeberg16 hours1-622/+99
| | | | | | | | | | Use the go-mod bbclass together with the gomod fetcher instead of the go-vendor bbclass. (From OE-Core rev: 42b46ab3b92a4f011592e8efcedead075731b8bd) Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: split guess_license functionEnguerrand de Ribaucourt2024-08-231-2/+2
| | | | | | | | | | | | | | | The npm recipetool handler redefines the license code the could be unified. In order to do this refactoring, extract the bits we'll need into separate functions. guess_license() is renamed to find_licenses() and is split into find_license_files() and match_licenses(). (From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2) Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Handle several go-import tags in go resolverSven Schwermer2024-04-231-14/+9
| | | | | | | | | | | | | | | | | | | | When dynamically resolving go modules, the HTML page may contain several go-import meta tags. We must handle all and pick the correct one based on the module name. An example for such a behaviour is gonum.org/v1/gonum: <meta name="go-import" content="gonum.org/v1/exp git https://github.com/gonum/exp"> <meta name="go-import" content="gonum.org/v1/gonum git https://github.com/gonum/gonum"> <meta name="go-import" content="gonum.org/v1/hdf5 git https://github.com/gonum/hdf5"> <meta name="go-import" content="gonum.org/v1/netlib git https://github.com/gonum/netlib"> <meta name="go-import" content="gonum.org/v1/plot git https://github.com/gonum/plot"> <meta name="go-import" content="gonum.org/v1/tools git https://github.com/gonum/tools"> (From OE-Core rev: 9c36a61e29359067165bddc7f2accdf2c4c8a761) Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Handle unclean response in go resolverSven Schwermer2024-04-231-4/+7
| | | | | | | | | | | | It appears that some go modules repond with a 404 error when trying to resolve them dynamically. The response body may still contain the go-import meta tag. An example for such behaviour is gonum.org/v1/gonum. (From OE-Core rev: 8f2e14ab6562a9a68819a960c66a258ea9dbe246) Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Disregard version in URL for replaced modulesVyacheslav Yurkov2024-01-191-5/+17
| | | | | | | | | | | | | | | | Major module version is a part of name, but not necessary part of the actual URL (See https://go.dev/ref/mod#module-path). Nevertheless, name detection function can't handle that suffix, so get rid of it to determine component name. For replaced modules that name might be different that the actual module name defined in go.mod file. (From OE-Core rev: 0cccfa1041d48f0ae3a2dc89a129cf7884fc08f0) Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Proceed even with a missing license fileVyacheslav Yurkov2024-01-191-0/+6
| | | | | | | | | | | Whenever the recipe uses a CLOSED license, the list is going to be empty. It's a discouraged practice not to have a license, but proceed anyway to finish recipe generation. (From OE-Core rev: 5ca920284d0946346f5b06f5e443c80d9d8b85ce) Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Don't fail on local go modulesVyacheslav Yurkov2024-01-191-13/+23
| | | | | | | | | | Local modules are usually referenced with a 'replace' directive in go.mod file. If that's the case, remove them from populating SRC_URI. (From OE-Core rev: 9f220f61e3e44a650a46ee997b47f1d87b7c4ef0) Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Add handler to create go recipesLukas Funke2023-11-061-0/+751
[RP: Replace python 3.9 use of removeprefix()] (From OE-Core rev: 049afb933f42851d56d2e6522150a32bcccf2a6f) Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>