Skip to content

Commit

Permalink
COde CHanges
Browse files Browse the repository at this point in the history
  • Loading branch information
“sagar committed Nov 10, 2023
1 parent 3027e4e commit 06567eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions CA.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<file src="out\net6.0\NuGet.Versioning.dll" target="tools"/>
<file src="out\net6.0\NuGet.Resolver.dll" target="tools"/>
<file src="out\net6.0\Tommy.dll" target="tools"/>
<file src="out\net6.0\YamlDotNet.dll" target="tools"/>
<file src="out\net6.0\runtimes\linux-arm\native\libpsl-native.so" target="tools\runtimes\linux-arm\native"/>
<file src="out\net6.0\runtimes\linux-arm64\native\libpsl-native.so" target="tools\runtimes\linux-arm64\native"/>
<file src="out\net6.0\runtimes\linux-musl-x64\native\libpsl-native.so" target="tools\runtimes\linux-musl-x64\native"/>
Expand Down
25 changes: 13 additions & 12 deletions src/LCT.SW360PackageCreator/URLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ public async Task<string> GetSourceUrlForConanPackage(string componentName, stri
response.EnsureSuccessStatusCode();
var jsonObject = await response.Content.ReadAsStringAsync();
packageSourcesInfo = deserializer.Deserialize<Sources>(jsonObject);
if (packageSourcesInfo.SourcesData.TryGetValue(version, out var release))
{
if (release.Url.GetType().Name.ToLowerInvariant() == "string")
{
componentSrcURL = release.Url.ToString();
}
else
{
List<object> urlList = (List<object>)release.Url;
componentSrcURL = urlList.FirstOrDefault() != null ? urlList.FirstOrDefault().ToString() : "";
}
}
}
catch (Exception)
{
Expand All @@ -193,18 +205,7 @@ public async Task<string> GetSourceUrlForConanPackage(string componentName, stri
{
_httpClient.Dispose();
}
if (packageSourcesInfo.SourcesData.TryGetValue(version,out var release))
{
if (release.Url.GetType().Name.ToLowerInvariant() == "string")
{
componentSrcURL = release.Url.ToString();
}
else
{
List<object> urlList = (List<object>)release.Url;
componentSrcURL = urlList.FirstOrDefault() != null ? urlList.FirstOrDefault().ToString() : "";
}
}



}
Expand Down

0 comments on commit 06567eb

Please sign in to comment.