@@ -128,28 +128,29 @@ DirectorySource(path::String; target::String = "", follow_symlinks::Bool=false)
128
128
DirectorySource (path, target, follow_symlinks)
129
129
130
130
# Try to guess if a URL is a Git repository
131
- isgitrepo (url:: AbstractString ) = endswith (url, " .git" ) || startswith (url, " git://" )
131
+ isgitrepo (url:: AbstractString ) = endswith (url, " .git" ) || startswith (url, " git://" ) || startswith (url, " ssh:// " )
132
132
133
133
# This is not meant to be used as source in the `build_tarballs.jl` scripts but
134
134
# only to set up the source in the workspace.
135
135
struct SetupSource{T<: AbstractSource }
136
+ url:: Union{String, Nothing}
136
137
path:: String
137
138
hash:: String
138
139
target:: String
139
140
follow_symlinks:: Bool
140
141
end
141
142
# `follow_symlinks` is used only for DirectorySource, let's have a method without it.
142
- SetupSource {T} (path:: String , hash:: String , target:: String ) where {T} =
143
- SetupSource {T} (path, hash, target, false )
143
+ SetupSource {T} (url :: Nothing , path:: String , hash:: String , target:: String ) where {T} =
144
+ SetupSource {T} (url, path, hash, target, false )
144
145
# This is used in wizard/obtain_source.jl to automatically guess the parameter
145
146
# of SetupSource from the URL
146
147
function SetupSource (url:: String , path:: String , hash:: String , target:: String )
147
148
if isgitrepo (url)
148
- return SetupSource {GitSource} (path, hash, target)
149
+ return SetupSource {GitSource} (url, path, hash, target)
149
150
elseif any (endswith (path, ext) for ext in archive_extensions)
150
- return SetupSource {ArchiveSource} (path, hash, target)
151
+ return SetupSource {ArchiveSource} (url, path, hash, target)
151
152
else
152
- return SetupSource {FileSource} (path, hash, target)
153
+ return SetupSource {FileSource} (url, path, hash, target)
153
154
end
154
155
end
155
156
@@ -173,7 +174,7 @@ function download_source(source::T; verbose::Bool = false, downloads_dir = stora
173
174
src_path = joinpath (downloads_dir, string (source. hash, " -" , basename (source. url)))
174
175
download_verify (source. url, source. hash, src_path)
175
176
end
176
- return SetupSource {T} (src_path, source. hash, gettarget (source))
177
+ return SetupSource {T} (source . url, src_path, source. hash, gettarget (source))
177
178
end
178
179
179
180
struct GitTransferProgress
245
246
246
247
function download_source (source:: GitSource ; kwargs... )
247
248
src_path = cached_git_clone (source. url; hash_to_check= source. hash, kwargs... )
248
- return SetupSource {GitSource} (src_path, source. hash, source. unpack_target)
249
+ return SetupSource {GitSource} (source . url, src_path, source. hash, source. unpack_target)
249
250
end
250
251
251
252
function download_source (source:: DirectorySource ; verbose:: Bool = false )
@@ -255,7 +256,7 @@ function download_source(source::DirectorySource; verbose::Bool = false)
255
256
if verbose
256
257
@info " Directory \" $(source. path) \" found"
257
258
end
258
- return SetupSource {DirectorySource} (abspath (source. path), " " , source. target, source. follow_symlinks)
259
+ return SetupSource {DirectorySource} (nothing , abspath (source. path), " " , source. target, source. follow_symlinks)
259
260
end
260
261
261
262
"""
0 commit comments