Skip to content

Commit

Permalink
add ENV["HAVE_INFOZIP"] option to support userimg.jl build
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jun 20, 2016
1 parent ac9c166 commit 3e678b3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/InfoZIP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ Base.read(cmd::Cmd) = readbytes(cmd)
end


have_infozip = false
try
if ismatch(r"^UnZip.*by Info-ZIP.", readstring(`unzip`))
have_infozip = true
have_infozip() = haskey(ENV, "HAVE_INFOZIP") || try
ismatch(r"^UnZip.*by Info-ZIP.", readstring(`unzip`))
catch ex
if isa(ex, Base.UVError) && ex.code == Base.UV_ENOENT
return false
end
catch
rethrow(ex)
end


if have_infozip
if have_infozip()
include("info_zip.jl")
else
warn("InfoZIP falling back to ZipFile.jl backend!")
include("zip_file.jl")
end

Expand Down

0 comments on commit 3e678b3

Please sign in to comment.