Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deprecated Array constructor #260

Merged
merged 3 commits into from
Jan 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/BinDeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ end

type Choices <: BuildStep
choices::Vector{Choice}
Choices() = new(Array(Choice,0))
Choices() = new(Choice[])
Choices(choices::Vector{Choice}) = new(choices)
end

Expand Down Expand Up @@ -303,7 +303,7 @@ dest(b::BuildStep) = b.dest

(|)(a::BuildStep,b::BuildStep) = SynchronousStepCollection()
function (|)(a::SynchronousStepCollection,b::SynchronousStepCollection)
if(a.cwd==b.cwd)
if a.cwd == b.cwd
append!(a.steps,b.steps)
else
push!(a.steps,b)
Expand All @@ -328,7 +328,7 @@ end
FileRule{T<:AbstractString}(files::Vector{T},step) = FileRule(AbstractString[f for f in files],step)

function lower(s::ChangeDirectory,collection)
if(!isempty(collection.steps))
if !isempty(collection.steps)
error("Change of Directory must be the first instruction")
end
collection.cwd = s.dir
Expand Down Expand Up @@ -369,10 +369,10 @@ end
if is_unix()
function lower(a::MakeTargets,collection)
cmd = `make -j8`
if(!isempty(a.dir))
if !isempty(a.dir)
cmd = `$cmd -C $(a.dir)`
end
if(!isempty(a.targets))
if !isempty(a.targets)
cmd = `$cmd $(a.targets)`
end
@dependent_steps ( setenv(cmd, adjust_env(a.env)), )
Expand Down Expand Up @@ -448,18 +448,18 @@ function run(f::Function)
end

function run(s::FileRule)
if(!any(map(isfile,s.file)))
if !any(map(isfile,s.file))
run(s.step)
if(!any(map(isfile,s.file)))
if !any(map(isfile,s.file))
error("File $(s.file) was not created successfully (Tried to run $(s.step) )")
end
end
end
function run(s::DirectoryRule)
info("Attempting to Create directory $(s.dir)")
if(!isdir(s.dir))
if !isdir(s.dir)
run(s.step)
if(!isdir(s.dir))
if !isdir(s.dir)
error("Directory $(s.dir) was not created successfully (Tried to run $(s.step) )")
end
else
Expand All @@ -483,12 +483,12 @@ function run(s::BuildStep)
end
function run(s::SynchronousStepCollection)
for x in s.steps
if(!isempty(s.cwd))
if !isempty(s.cwd)
info("Changing Directory to $(s.cwd)")
cd(s.cwd)
end
run(x)
if(!isempty(s.oldcwd))
if !isempty(s.oldcwd)
info("Changing Directory to $(s.oldcwd)")
cd(s.oldcwd)
end
Expand Down
2 changes: 1 addition & 1 deletion src/debug.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function show(io::IO, deps::LibraryGroup)
print(io," - Library Group \"$(deps.name)\"")
all = allf(deps)
providers = satisfied_providers(deps,all)
if providers != nothing && !(isempty(providers))
if providers !== nothing && !isempty(providers)
print(io," (satisfied by ",join(providers,", "),")")
end
if !applicable(deps)
Expand Down
14 changes: 7 additions & 7 deletions src/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function _library_dependency(context::PackageContext, name; properties...)
group = v
end
end
r = LibraryDependency(name,context,Array(Tuple{DependencyProvider,Dict{Symbol,Any}},0),Array(Tuple{DependencyHelper,Dict{Symbol,Any}},0),Dict{Symbol,Any}(properties),validate)
r = LibraryDependency(name, context, Tuple{DependencyProvider,Dict{Symbol,Any}}[], Tuple{DependencyHelper,Dict{Symbol,Any}}[], Dict{Symbol,Any}(properties), validate)
if group !== nothing
push!(group.deps,r)
else
Expand Down Expand Up @@ -114,8 +114,8 @@ function available_versions(p::AptGet)
vs = l[(1+length("Version: ")):end]
push!(vers, vs)
end
elseif lookfor_version && (m = match(DEBIAN_VERSION_REGEX, l)) != nothing
m.captures[2] != nothing ? push!(vers, m.captures[2]) :
elseif lookfor_version && (m = match(DEBIAN_VERSION_REGEX, l)) !== nothing
m.captures[2] !== nothing ? push!(vers, m.captures[2]) :
push!(vers, m.captures[4])
elseif startswith(l, "Versions:")
lookfor_version = true
Expand Down Expand Up @@ -239,7 +239,7 @@ immutable SystemPaths <: DependencyProvider; end

show(io::IO, ::SystemPaths) = print(io,"System Paths")

using URIParser, Compat
using URIParser
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module already has a using Compat so it is not needed to repeat it.

export URI

type NetworkSource <: Sources
Expand Down Expand Up @@ -495,7 +495,7 @@ function _find_library(dep::LibraryDependency; provider = Any)
# Make sure we keep the defaults first, but also look in the other directories
providers = unique([reduce(vcat,[getallproviders(dep,p) for p in defaults]);dep.providers])
for (p,opts) in providers
(p != nothing && can_use(typeof(p)) && can_provide(p,opts,dep)) || continue
(p !== nothing && can_use(typeof(p)) && can_provide(p,opts,dep)) || continue
paths = AbstractString[]

# Allow user to override installation path
Expand Down Expand Up @@ -686,7 +686,7 @@ function viable_providers(deps::LibraryGroup)
continue
end
providers = map(x->typeof(x[1]),dep.providers)
if vp == nothing
if vp === nothing
vp = providers
else
vp = intersect(vp,providers)
Expand Down Expand Up @@ -1013,7 +1013,7 @@ macro load_dependencies(args...)
end
end)
end
if arg1 != nothing && !isa(arg1,Function)
if arg1 !== nothing && !isa(arg1,Function)
if !isempty(arg1)
errrormsg = "The following required libraries were not declared in build.jl:\n"
for k in (isa(arg1,Vector) ? arg1 : keys(arg1))
Expand Down