Skip to content

Commit 60f8d0b

Browse files
committed
Normalize version range spacing in compress function
1 parent df31524 commit 60f8d0b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Compress.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ function compress(path::AbstractString, uncompressed::Dict,
8181
compressed = Dict{String,Dict{String,Any}}()
8282
for ((k, v), vers) in inverted
8383
for r in compress_versions(versions, sort!(vers)).ranges
84-
get!(compressed, string(r), Dict{String,Any}())[k] = v
84+
# Existing version ranges in `Compat.toml` files are stored without spaces.
85+
# New version ranges are added with spaces in their string representation.
86+
# Remove all spaces, so that equal version ranges compare equal as strings.
87+
# This is a temporary work-around that will become unnecessary when
88+
# "all this is rewirtten to use VersionNumbers", as suggested above.
89+
get!(compressed, replace(string(r), " " => ""), Dict{String,Any}())[k] = v
8590
end
8691
end
8792
return compressed

0 commit comments

Comments
 (0)