Skip to content

Commit

Permalink
only look up name from url if it is unset
Browse files Browse the repository at this point in the history
(cherry picked from commit 3a0e2ab727380ccb2c9b284282223e94ee4af2cc)
(cherry picked from commit e9de77f2da8a403c63ba4cc937195b793b6a0abc)
  • Loading branch information
KristofferC committed Sep 18, 2018
1 parent 4a72ad4 commit de7c7c3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions stdlib/Pkg/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -708,14 +708,16 @@ function parse_package!(ctx, pkg, project_path)
if !isempty(ctx.old_pkg2_clone_name) # remove when legacy CI script support is removed
pkg.name = ctx.old_pkg2_clone_name
else
# This is an old style package, get the name from src/PackageName
if isdir_windows_workaround(pkg.repo.url)
m = match(reg_pkg, abspath(pkg.repo.url))
else
m = match(reg_pkg, pkg.repo.url)
# This is an old style package, if not set, get the name from src/PackageName
if !has_name(pkg)
if isdir_windows_workaround(pkg.repo.url)
m = match(reg_pkg, abspath(pkg.repo.url))
else
m = match(reg_pkg, pkg.repo.url)
end
m === nothing && pkgerror("cannot determine package name from URL or path: $(pkg.repo.url), provide a name argument to `PackageSpec`")
pkg.name = m.captures[1]
end
m === nothing && pkgerror("cannot determine package name from URL or path: $(pkg.repo.url)")
pkg.name = m.captures[1]
end
reg_uuids = registered_uuids(env, pkg.name)
is_registered = !isempty(reg_uuids)
Expand Down

0 comments on commit de7c7c3

Please sign in to comment.