mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-18 01:27:11 +01:00
added code to strip -py2 from the identified version
Former-commit-id: 4e8f8f21a3ac21099b6ea4524f5299da95973943
This commit is contained in:
@@ -35,8 +35,8 @@ public final class DependencyVersionUtil {
|
||||
*/
|
||||
private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha|\\d+)|[a-zA-Z_-]{1,3}\\d{0,8}))?");
|
||||
/**
|
||||
* Regular expression to extract a single version number without periods. This is a last ditch effort just to check
|
||||
* in case we are missing a version number using the previous regex.
|
||||
* Regular expression to extract a single version number without periods. This is a last ditch effort just to check in case we
|
||||
* are missing a version number using the previous regex.
|
||||
*/
|
||||
private static final Pattern RX_SINGLE_VERSION = Pattern.compile("\\d+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?");
|
||||
|
||||
@@ -89,6 +89,9 @@ public final class DependencyVersionUtil {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (version != null && version.endsWith("-py2") && version.length() > 4) {
|
||||
version = version.substring(0, version.length() - 4);
|
||||
}
|
||||
return new DependencyVersion(version);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user