Skip to content

Commit

Permalink
Merge pull request #228 from JuliaPackaging/sf/0.7
Browse files Browse the repository at this point in the history
Add `Compat` for `Libdl` and `devnull` on 0.7
  • Loading branch information
staticfloat authored May 2, 2018
2 parents f0acfc6 + 74cd408 commit 27f44de
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
julia 0.6
BinDeps
JSON
Compat 0.55.0
16 changes: 8 additions & 8 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ function brew(cmd::Cmd; no_stderr=false, no_stdout=false, verbose::Bool=false, f
cmd = add_flags(`$brew_exe $cmd`, Dict(`--verbose` => verbose, `--force` => force, `--quiet` => quiet))

if no_stderr
cmd = pipeline(cmd, stderr=DevNull)
cmd = pipeline(cmd, stderr=devnull)
end
if no_stdout
cmd = pipeline(cmd, stdout=DevNull)
cmd = pipeline(cmd, stdout=devnull)
end
return run(cmd)
end
Expand All @@ -31,10 +31,10 @@ function brewchomp(cmd::Cmd; no_stderr=false, no_stdout=false, verbose::Bool=fal
cmd = add_flags(`$brew_exe $cmd`, Dict(`--verbose` => verbose, `--force` => force, `--quiet` => quiet))

if no_stderr
cmd = pipeline(cmd, stderr=DevNull)
cmd = pipeline(cmd, stderr=devnull)
end
if no_stdout
cmd = pipeline(cmd, stdout=DevNull)
cmd = pipeline(cmd, stdout=devnull)
end
return readchomp(cmd)
end
Expand Down Expand Up @@ -339,8 +339,8 @@ after all dependencies of `name`. If a dependency of `name` is not already in
"""
function insert_after_dependencies(tree::Dict, sorted_deps::Vector{BrewPkg}, name::AbstractString)
# First off, are we already in sorted_deps? If so, back out!
self_idx = findfirst(x -> (fullname(x) == name), sorted_deps)
if self_idx != 0
self_idx = Compat.findfirst(x -> (fullname(x) == name), sorted_deps)
if self_idx != nothing
return self_idx
end

Expand All @@ -349,10 +349,10 @@ function insert_after_dependencies(tree::Dict, sorted_deps::Vector{BrewPkg}, nam
# Iterate over all dependencies
for dpkg in tree[name]
# Is this dependency already in the sorted_deps?
idx = findfirst(x -> (fullname(x) == fullname(dpkg)), sorted_deps)
idx = Compat.findfirst(x -> (fullname(x) == fullname(dpkg)), sorted_deps)

# If the dependency is not already in this list, then recurse into it!
if idx == 0
if self_idx == nothing
idx = insert_after_dependencies(tree, sorted_deps, fullname(dpkg))
end

Expand Down
2 changes: 1 addition & 1 deletion src/Homebrew.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Homebrew

import Base: show
@static if VERSION > v"0.7-" using Unicode end
using JSON
using JSON, Compat

# Find homebrew installation prefix
const brew_prefix = abspath(joinpath(dirname(@__FILE__),"..","deps", "usr"))
Expand Down
2 changes: 1 addition & 1 deletion src/private_API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function update_tag(;verbose::Bool=false)
if verbose
git = cmd -> run(`git $cmd`)
else
git = cmd -> run(pipeline(`git $cmd`, stdout=DevNull, stderr=DevNull))
git = cmd -> run(pipeline(`git $cmd`, stdout=devnull, stderr=devnull))
end

cd(brew_prefix) do
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Checks whether the command-line tools are installed, as reported by xcode-select
"""
function clt_installed()
try
!isempty(readchomp(pipeline(`/usr/bin/xcode-select -print-path`, stderr=DevNull)))
!isempty(readchomp(pipeline(`/usr/bin/xcode-select -print-path`, stderr=devnull)))
catch
return false
end
Expand Down

0 comments on commit 27f44de

Please sign in to comment.