Skip to content

Commit

Permalink
fix: temp fix to PyPI for IQ to get results, set extension to tar.gz …
Browse files Browse the repository at this point in the history
…for now
  • Loading branch information
DarthHater committed Nov 26, 2019
1 parent 0e0333d commit 25eed9d
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions ext-src/packages/pypi/PyPIDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,8 @@ export class PyPIDependencies extends PackageDependenciesHelper implements Packa
return {
components: _.map(
this.Dependencies,
(d: {
Hash: any;
Name: any;
Qualifier: any;
Extension: any;
Version: any;
}) => ({
hash: null,
componentIdentifier: {
format: "pypi",
coordinates: {
name: d.Name,
version: d.Version,
qualifier: d.Qualifier, // "py2.py3-none-any"
extension: d.Extension // "whl"
}
}
(d) => ({
packageUrl: d.toPurl() + `?extension=tar.gz`
})
)
};
Expand All @@ -82,20 +67,24 @@ export class PyPIDependencies extends PackageDependenciesHelper implements Packa
public toComponentEntries(data: any): Array<ComponentEntry> {
let components = new Array<ComponentEntry>();
for (let entry of data.components) {
const purl: string = entry.packageUrl;
const parts: string[] = purl.substr(9, purl.length).split("@");
const packageId =
entry.componentIdentifier.coordinates.name;
parts[0];

const version: string = parts[1].split("?")[0];

let componentEntry = new ComponentEntry(
packageId,
entry.componentIdentifier.coordinates.version,
version,
ScanType.NexusIq
);
components.push(componentEntry);
let coordinates = new PyPICoordinate(
entry.componentIdentifier.coordinates.name,
entry.componentIdentifier.coordinates.version,
entry.componentIdentifier.coordinates.extension,
entry.componentIdentifier.coordinates.qualifier
parts[0],
version,
"",
""
);
this.CoordinatesToComponents.set(
coordinates.asCoordinates(),
Expand Down

0 comments on commit 25eed9d

Please sign in to comment.