summarylogtreecommitdiffstats
path: root/versionrange-check.diff
blob: 08b1bbe0270cf501d6f179dc5b5459c0337c5bab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/src/DistroHelper.jl b/src/DistroHelper.jl
index ee9ae0b..bf4199e 100644
--- a/src/DistroHelper.jl
+++ b/src/DistroHelper.jl
@@ -7,6 +7,7 @@ module DistroHelper
 const JL_REGISTRY_URL = "https://github.com/JuliaRegistries/General/raw/master/"
 
 using Pkg
+include("versions.jl")
 
 """
 Return the slug string for the given package in specific version.
@@ -44,9 +45,9 @@ depends("Deps.toml")
 """
 function depends(deps::AbstractString, version::Any = nothing)
 	alldeps = Pkg.TOML.parsefile(deps)
-	bounds = map(x -> VersionNumber.(x), split.(keys(alldeps), "-"))
+	bounds = [VersionRange(x) for x in keys(alldeps)]
 	ver	= (version == nothing) ? maximum(maximum(bounds)) : VersionNumber(version) 
-	mask = [ver >= x[1] && ver <= x[2] for x in bounds]
+	mask = [Base.in(ver, x) for x in bounds]
 	realdeps = Dict{String,Any}()
 	for (k, v) in zip(mask, values(alldeps))
 		if k for (i, j) in v realdeps[i] = j end end