diff options
author | Christian Lindeberg <christian.lindeberg@axis.com> | 2025-03-20 11:19:49 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-27 11:19:33 +0000 |
commit | c00ad319d49537e3277fcf70196eec534a958959 (patch) | |
tree | bf91d678e8bb193df929aefc4af6593e0fca69e8 /bitbake/lib/bb/tests/fetch.py | |
parent | ecff1d6a2dcfcd243d15039f08727889e7889158 (diff) | |
download | poky-c00ad319d49537e3277fcf70196eec534a958959.tar.gz |
bitbake: fetch2/gomod: Fix mirroring problem
Build the 'downloadfilename' parameter by replacing path separators in
the module path like the git fetcher builds the mirror tar ball name.
Copy the downloaded file in the fetcher's unpack method like the crate
fetcher instead of calling the base fetcher's unpack method.
(Bitbake rev: 7762cea087597019460d66b04268757bd46befdf)
Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 486c10cd08..f2f140ff24 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -3378,6 +3378,8 @@ class GoModTest(FetcherTest): | |||
3378 | fetcher = bb.fetch2.Fetch(urls, self.d) | 3378 | fetcher = bb.fetch2.Fetch(urls, self.d) |
3379 | ud = fetcher.ud[urls[0]] | 3379 | ud = fetcher.ud[urls[0]] |
3380 | self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.zip') | 3380 | self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.zip') |
3381 | self.assertEqual(ud.parm['downloadfilename'], 'github.com.Azure.azure-sdk-for-go.sdk.storage.azblob@v1.0.0.zip') | ||
3382 | self.assertEqual(ud.parm['name'], 'github.com/Azure/azure-sdk-for-go/sdk/storage/azblob@v1.0.0') | ||
3381 | 3383 | ||
3382 | fetcher.download() | 3384 | fetcher.download() |
3383 | fetcher.unpack(self.unpackdir) | 3385 | fetcher.unpack(self.unpackdir) |
@@ -3395,6 +3397,8 @@ class GoModTest(FetcherTest): | |||
3395 | fetcher = bb.fetch2.Fetch(urls, self.d) | 3397 | fetcher = bb.fetch2.Fetch(urls, self.d) |
3396 | ud = fetcher.ud[urls[0]] | 3398 | ud = fetcher.ud[urls[0]] |
3397 | self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.mod') | 3399 | self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.mod') |
3400 | self.assertEqual(ud.parm['downloadfilename'], 'github.com.Azure.azure-sdk-for-go.sdk.storage.azblob@v1.0.0.mod') | ||
3401 | self.assertEqual(ud.parm['name'], 'github.com/Azure/azure-sdk-for-go/sdk/storage/azblob@v1.0.0') | ||
3398 | 3402 | ||
3399 | fetcher.download() | 3403 | fetcher.download() |
3400 | fetcher.unpack(self.unpackdir) | 3404 | fetcher.unpack(self.unpackdir) |
@@ -3409,6 +3413,7 @@ class GoModTest(FetcherTest): | |||
3409 | fetcher = bb.fetch2.Fetch(urls, self.d) | 3413 | fetcher = bb.fetch2.Fetch(urls, self.d) |
3410 | ud = fetcher.ud[urls[0]] | 3414 | ud = fetcher.ud[urls[0]] |
3411 | self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip') | 3415 | self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip') |
3416 | self.assertEqual(ud.parm['downloadfilename'], 'gopkg.in.ini.v1@v1.67.0.zip') | ||
3412 | self.assertEqual(ud.parm['name'], 'gopkg.in/ini.v1@v1.67.0') | 3417 | self.assertEqual(ud.parm['name'], 'gopkg.in/ini.v1@v1.67.0') |
3413 | 3418 | ||
3414 | fetcher.download() | 3419 | fetcher.download() |
@@ -3427,6 +3432,8 @@ class GoModTest(FetcherTest): | |||
3427 | fetcher = bb.fetch2.Fetch(urls, self.d) | 3432 | fetcher = bb.fetch2.Fetch(urls, self.d) |
3428 | ud = fetcher.ud[urls[0]] | 3433 | ud = fetcher.ud[urls[0]] |
3429 | self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip') | 3434 | self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip') |
3435 | self.assertEqual(ud.parm['downloadfilename'], 'gopkg.in.ini.v1@v1.67.0.zip') | ||
3436 | self.assertEqual(ud.parm['name'], 'gopkg.in/ini.v1@v1.67.0') | ||
3430 | 3437 | ||
3431 | fetcher.download() | 3438 | fetcher.download() |
3432 | fetcher.unpack(self.unpackdir) | 3439 | fetcher.unpack(self.unpackdir) |
@@ -3444,6 +3451,8 @@ class GoModTest(FetcherTest): | |||
3444 | fetcher = bb.fetch2.Fetch(urls, self.d) | 3451 | fetcher = bb.fetch2.Fetch(urls, self.d) |
3445 | ud = fetcher.ud[urls[0]] | 3452 | ud = fetcher.ud[urls[0]] |
3446 | self.assertEqual(ud.url, 'https://proxy.golang.org/go.opencensus.io/%40v/v0.24.0.zip') | 3453 | self.assertEqual(ud.url, 'https://proxy.golang.org/go.opencensus.io/%40v/v0.24.0.zip') |
3454 | self.assertEqual(ud.parm['downloadfilename'], 'go.opencensus.io@v0.24.0.zip') | ||
3455 | self.assertEqual(ud.parm['name'], 'go.opencensus.io@v0.24.0') | ||
3447 | 3456 | ||
3448 | fetcher.download() | 3457 | fetcher.download() |
3449 | fetcher.unpack(self.unpackdir) | 3458 | fetcher.unpack(self.unpackdir) |