@@ -1316,20 +1316,23 @@ class FetchData(object):
self.setup = False
def configure_checksum(checksum_id):
+ checksum_plain_name = "%ssum" % checksum_id
if "name" in self.parm:
checksum_name = "%s.%ssum" % (self.parm["name"], checksum_id)
else:
- checksum_name = "%ssum" % checksum_id
-
- setattr(self, "%s_name" % checksum_id, checksum_name)
+ checksum_name = checksum_plain_name
if checksum_name in self.parm:
checksum_expected = self.parm[checksum_name]
+ elif checksum_plain_name in self.parm:
+ checksum_expected = self.parm[checksum_plain_name]
+ checksum_name = checksum_plain_name
elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3", "az", "crate", "gs", "gomod"]:
checksum_expected = None
else:
checksum_expected = d.getVarFlag("SRC_URI", checksum_name)
+ setattr(self, "%s_name" % checksum_id, checksum_name)
setattr(self, "%s_expected" % checksum_id, checksum_expected)
self.names = self.parm.get("name",'default').split(',')
@@ -119,10 +119,7 @@ class GoMod(Wget):
('https', proxy, '/' + path, None, None, None))
ud.parm['downloadfilename'] = path
- # Set name parameter if sha256sum is set in recipe
- name = f"{module}@{ud.parm['version']}"
- if d.getVarFlag('SRC_URI', name + '.sha256sum'):
- ud.parm['name'] = name
+ ud.parm['name'] = f"{module}@{ud.parm['version']}"
# Set subdir for unpack
ud.parm['subdir'] = os.path.join(moddir, 'cache/download',
@@ -3391,7 +3391,6 @@ class GoModTest(FetcherTest):
fetcher = bb.fetch2.Fetch(urls, self.d)
ud = fetcher.ud[urls[0]]
self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.zip')
- self.assertNotIn('name', ud.parm)
fetcher.download()
fetcher.unpack(self.unpackdir)
@@ -3409,7 +3408,6 @@ class GoModTest(FetcherTest):
fetcher = bb.fetch2.Fetch(urls, self.d)
ud = fetcher.ud[urls[0]]
self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.mod')
- self.assertNotIn('name', ud.parm)
fetcher.download()
fetcher.unpack(self.unpackdir)
@@ -3442,7 +3440,6 @@ class GoModTest(FetcherTest):
fetcher = bb.fetch2.Fetch(urls, self.d)
ud = fetcher.ud[urls[0]]
self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip')
- self.assertNotIn('name', ud.parm)
fetcher.download()
fetcher.unpack(self.unpackdir)
@@ -3460,7 +3457,6 @@ class GoModTest(FetcherTest):
fetcher = bb.fetch2.Fetch(urls, self.d)
ud = fetcher.ud[urls[0]]
self.assertEqual(ud.url, 'https://proxy.golang.org/go.opencensus.io/%40v/v0.24.0.zip')
- self.assertNotIn('name', ud.parm)
fetcher.download()
fetcher.unpack(self.unpackdir)