From 9b4fc8c9b6c3dfd39fe667bec184ee80c6c04f1c Mon Sep 17 00:00:00 2001 From: mikhail-j Date: Mon, 19 Nov 2018 03:50:39 -0500 Subject: [PATCH 1/4] Update Mozilla CA certificate store to latest (10-17-2018) for libgit2 SSL. --- deps/Versions.make | 2 +- deps/checksums/cacert-2018-06-20.pem/md5 | 1 - deps/checksums/cacert-2018-06-20.pem/sha512 | 1 - deps/checksums/cacert-2018-10-17.pem/md5 | 1 + deps/checksums/cacert-2018-10-17.pem/sha512 | 1 + 5 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 deps/checksums/cacert-2018-06-20.pem/md5 delete mode 100644 deps/checksums/cacert-2018-06-20.pem/sha512 create mode 100644 deps/checksums/cacert-2018-10-17.pem/md5 create mode 100644 deps/checksums/cacert-2018-10-17.pem/sha512 diff --git a/deps/Versions.make b/deps/Versions.make index 3311ad8a5f4f8..7bdb160fe9b3e 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -15,4 +15,4 @@ CURL_VER = 7.56.0 # Specify the version of the Mozilla CA Certificate Store to obtain. # The versions of cacert.pem are identified by the date (YYYY-MM-DD) of their changes. # See https://curl.haxx.se/docs/caextract.html for more details. -MOZILLA_CACERT_VERSION := 2018-06-20 +MOZILLA_CACERT_VERSION := 2018-10-17 diff --git a/deps/checksums/cacert-2018-06-20.pem/md5 b/deps/checksums/cacert-2018-06-20.pem/md5 deleted file mode 100644 index b28eef364035e..0000000000000 --- a/deps/checksums/cacert-2018-06-20.pem/md5 +++ /dev/null @@ -1 +0,0 @@ -247294da2f913ad84609b3bdd85c16f3 diff --git a/deps/checksums/cacert-2018-06-20.pem/sha512 b/deps/checksums/cacert-2018-06-20.pem/sha512 deleted file mode 100644 index 96befa466d201..0000000000000 --- a/deps/checksums/cacert-2018-06-20.pem/sha512 +++ /dev/null @@ -1 +0,0 @@ -f0e369cad84d2d0157d68dec9d5cb2fab0d0350952716f3273a861db9e31fc3661efc7958cd53201cdc421475df8bfc66c0acbfe293d55835b60dbd72f8da2e6 diff --git a/deps/checksums/cacert-2018-10-17.pem/md5 b/deps/checksums/cacert-2018-10-17.pem/md5 new file mode 100644 index 0000000000000..79cd13faf56de --- /dev/null +++ b/deps/checksums/cacert-2018-10-17.pem/md5 @@ -0,0 +1 @@ +882db4f54c25b5157cef6c0d182e729e diff --git a/deps/checksums/cacert-2018-10-17.pem/sha512 b/deps/checksums/cacert-2018-10-17.pem/sha512 new file mode 100644 index 0000000000000..bc37f725735af --- /dev/null +++ b/deps/checksums/cacert-2018-10-17.pem/sha512 @@ -0,0 +1 @@ +10b5d87eeeb52e38f49b97b4cb8dc359dbfef6ffe581f63003356ef691fc20a301d9550980eff3f30457c0564a9f6b6368783c8bd116ff35fcda3f32b26dad3f From 3900658873d08d9ddc88eba767c7389a8ae55e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Besan=C3=A7on?= Date: Mon, 19 Nov 2018 15:31:48 +0100 Subject: [PATCH 2/4] Remove "slave" variable (#30058) * replace master, slave -> pty_master pty_slave --- contrib/generate_precompile.jl | 26 +++++++++++++------------- stdlib/LibGit2/test/libgit2.jl | 16 ++++++++-------- stdlib/REPL/test/repl.jl | 12 ++++++------ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/contrib/generate_precompile.jl b/contrib/generate_precompile.jl index 8deb50580cbea..0b9cc449a85a0 100644 --- a/contrib/generate_precompile.jl +++ b/contrib/generate_precompile.jl @@ -81,11 +81,11 @@ function generate_precompile_statements() # Fake being cygwin pipename = """\\\\?\\pipe\\cygwin-$("0"^16)-pty10-abcdef""" server = listen(pipename) - slave = connect(pipename) - @assert ccall(:jl_ispty, Cint, (Ptr{Cvoid},), slave.handle) == 1 - master = accept(server) + pty_slave = connect(pipename) + @assert ccall(:jl_ispty, Cint, (Ptr{Cvoid},), pty_slave.handle) == 1 + pty_master = accept(server) else - slave, master = open_fake_pty() + pty_slave, pty_master = open_fake_pty() end done = false blackhole = Sys.isunix() ? "/dev/null" : "nul" @@ -96,12 +96,12 @@ function generate_precompile_statements() --compile=all --startup-file=no --color=yes -e 'import REPL; REPL.Terminals.is_precompiling[] = true' -i`, - slave, slave, slave; wait=false) - readuntil(master, "julia>", keep=true) + pty_slave, pty_slave, pty_slave; wait=false) + readuntil(pty_master, "julia>", keep=true) t = @async begin while true sleep(0.5) - s = String(readavailable(master)) + s = String(readavailable(pty_master)) write(repl_output_buffer, s) if occursin("__PRECOMPILE_END__", s) break @@ -110,18 +110,18 @@ function generate_precompile_statements() end if have_repl for l in split(precompile_script, '\n'; keepempty=false) - write(master, l, '\n') + write(pty_master, l, '\n') end end - write(master, "print(\"__PRECOMPILE\", \"_END__\")", '\n') + write(pty_master, "print(\"__PRECOMPILE\", \"_END__\")", '\n') wait(t) # TODO Figure out why exit() on Windows doesn't exit the process if Sys.iswindows() - print(master, "ccall(:_exit, Cvoid, (Cint,), 0)\n") + print(pty_master, "ccall(:_exit, Cvoid, (Cint,), 0)\n") else - write(master, "exit()\n") - readuntil(master, "exit()\r\e[13C\r\n") + write(pty_master, "exit()\n") + readuntil(pty_master, "exit()\r\e[13C\r\n") # @assert bytesavailable(master) == 0 end wait(p) @@ -132,7 +132,7 @@ function generate_precompile_statements() -e0`) end end - close(master) + close(pty_master) # Check what the REPL displayed # repl_output = String(take!(repl_output_buffer)) diff --git a/stdlib/LibGit2/test/libgit2.jl b/stdlib/LibGit2/test/libgit2.jl index b075fdeeb14b6..9add9585c11b2 100644 --- a/stdlib/LibGit2/test/libgit2.jl +++ b/stdlib/LibGit2/test/libgit2.jl @@ -47,8 +47,8 @@ function challenge_prompt(cmd::Cmd, challenges; timeout::Integer=60, debug::Bool "Process output found:\n\"\"\"\n$str\n\"\"\"" end out = IOBuffer() - with_fake_pty() do slave, master - p = run(detach(cmd), slave, slave, slave, wait=false) + with_fake_pty() do pty_slave, pty_master + p = run(detach(cmd), pty_slave, pty_slave, pty_slave, wait=false) # Kill the process if it takes too long. Typically occurs when process is waiting # for input. @@ -75,21 +75,21 @@ function challenge_prompt(cmd::Cmd, challenges; timeout::Integer=60, debug::Bool process_running(p) && kill(p, Base.SIGKILL) end - close(master) + close(pty_master) end for (challenge, response) in challenges - write(out, readuntil(master, challenge, keep=true)) - if !isopen(master) + write(out, readuntil(pty_master, challenge, keep=true)) + if !isopen(pty_master) error("Could not locate challenge: \"$challenge\". ", format_output(out)) end - write(master, response) + write(pty_master, response) end # Capture output from process until `master` is closed - while !eof(master) - write(out, readavailable(master)) + while !eof(pty_master) + write(out, readavailable(pty_master)) end status = fetch(timer) diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index 2a290eb2ec3d3..f3011415085e6 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -729,22 +729,22 @@ ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 1) let exename = Base.julia_cmd() # Test REPL in dumb mode if !Sys.iswindows() - with_fake_pty() do slave, master + with_fake_pty() do pty_slave, pty_master nENV = copy(ENV) nENV["TERM"] = "dumb" - p = run(setenv(`$exename --startup-file=no -q`,nENV),slave,slave,slave,wait=false) - output = readuntil(master,"julia> ",keep=true) + p = run(setenv(`$exename --startup-file=no -q`,nENV),pty_slave,pty_slave,pty_slave,wait=false) + output = readuntil(pty_master,"julia> ",keep=true) if ccall(:jl_running_on_valgrind,Cint,()) == 0 # If --trace-children=yes is passed to valgrind, we will get a # valgrind banner here, not just the prompt. @test output == "julia> " end - write(master,"1\nexit()\n") + write(pty_master,"1\nexit()\n") wait(p) - output = readuntil(master,' ',keep=true) + output = readuntil(pty_master,' ',keep=true) @test output == "1\r\nexit()\r\n1\r\n\r\njulia> " - @test bytesavailable(master) == 0 + @test bytesavailable(pty_master) == 0 end end From be9837257faf3981db448eda695bd3841543115a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 19 Nov 2018 15:59:15 +0100 Subject: [PATCH 3/4] Add sh color syntaxing in README (#30081) --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 19d19d9c3e648..7699f5673ad74 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ Then, acquire the source code by cloning the git repository: git clone git://github.com/JuliaLang/julia.git (If you are behind a firewall, you may need to use the `https` protocol instead of the `git` protocol: - - git config --global url."https://".insteadOf git:// - +```sh +git config --global url."https://".insteadOf git:// +``` Be sure to also configure your system to use the appropriate proxy settings, e.g. by setting the `https_proxy` and `http_proxy` variables.) By default you will be building the latest unstable version of Julia. However, most users should use the most recent stable version of Julia, which is currently the `1.0` series of releases. You can get this version by changing to the Julia directory and running @@ -135,10 +135,10 @@ or Windows, take a look at the detailed notes in If you have previously downloaded `julia` using `git clone`, you can update the existing source tree using `git pull` rather than starting anew: - - cd julia - git pull && make - +```sh +cd julia +git pull && make +``` Assuming that you had made no changes to the source tree that will conflict with upstream updates, these commands will trigger a build to update to the latest version. @@ -387,10 +387,10 @@ As a high-performance numerical language, Julia should be linked to a multi-thre ### Intel MKL For a 64-bit architecture, the environment should be set up as follows: - - # bash - source /path/to/intel/bin/compilervars.sh intel64 - +```sh +# bash +source /path/to/intel/bin/compilervars.sh intel64 +``` Add the following to the `Make.user` file: USE_INTEL_MKL = 1 @@ -417,9 +417,9 @@ The Julia source code is organized as follows: If you would rather not compile the latest Julia from source, platform-specific tarballs with pre-compiled binaries are also [available for download](https://julialang.org/downloads/). You can either run the `julia` executable using its full path in the directory created above, or add that directory to your executable path so that you can run the Julia program from anywhere (in the current shell session): - - export PATH="$(pwd)/julia:$PATH" - +```sh +export PATH="$(pwd)/julia:$PATH" +``` Now you should be able to run Julia like this: julia From a1aa542343c8748ea7178c2772e2bfddc7d00adc Mon Sep 17 00:00:00 2001 From: lewisl Date: Mon, 19 Nov 2018 07:22:30 -0800 Subject: [PATCH 4/4] Update the Regex section of strings.md. (#29921) * Update the Regex section of strings.md. This adds a brief description and example of using the Regex constructor to create regex strings programmatically. * Update doc/src/manual/strings.md Co-Authored-By: lewisl * Update doc/src/manual/strings.md Co-Authored-By: lewisl * Update doc/src/manual/strings.md Co-Authored-By: lewisl --- doc/src/manual/strings.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/src/manual/strings.md b/doc/src/manual/strings.md index 9e3606c2e10b0..87a9ed548c636 100644 --- a/doc/src/manual/strings.md +++ b/doc/src/manual/strings.md @@ -936,6 +936,33 @@ ERROR: syntax: invalid escape sequence Triple-quoted regex strings, of the form `r"""..."""`, are also supported (and may be convenient for regular expressions containing quotation marks or newlines). +The `Regex()` constructor may be used to create a valid regex string programmatically. This permits using the contents of string variables and other string operations when constructing the regex string. Any of the regex codes above can be used within the single string argument to `Regex()`. Here are some examples: + +```jldoctest +julia> using Dates + +julia> d = Date(1962,7,10) +1962-07-10 + +julia> regex_d = Regex("Day " * string(day(d))) +r"Day 10" + +julia> match(regex_d, "It happened on Day 10") +RegexMatch("Day 10") + +julia> name = "Jon" +"Jon" + +julia> regex_name = Regex("[\"( ]$name[\") ]") # interpolate value of name +r"[\"( ]Jon[\") ]" + +julia> match(regex_name," Jon ") +RegexMatch(" Jon ") + +julia> match(regex_name,"[Jon]") === nothing +true +``` + ## [Byte Array Literals](@id man-byte-array-literals) Another useful non-standard string literal is the byte-array string literal: `b"..."`. This