From 71091b98d35316e9474504f9edabe54c7187e82f Mon Sep 17 00:00:00 2001 From: wildart Date: Thu, 19 May 2016 19:12:47 -0400 Subject: [PATCH] terminate `Pkg.update` on `InterruptException` --- base/pkg/entry.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/pkg/entry.jl b/base/pkg/entry.jl index 0ad7b0625f42dd..51d322ced7667f 100644 --- a/base/pkg/entry.jl +++ b/base/pkg/entry.jl @@ -377,6 +377,7 @@ function update(branch::AbstractString) end creds = LibGit2.CachedCredentials() fixed = Read.fixed(avail,instd) + stopupdate = false for (pkg,ver) in fixed ispath(pkg,".git") || continue with(GitRepo, pkg) do repo @@ -394,6 +395,7 @@ function update(branch::AbstractString) cex = CapturedException(err, catch_backtrace()) push!(deferred_errors, PkgError("Package $pkg cannot be updated.", cex)) success = false + stopupdate = isa(err, InterruptException) end if success post_sha = string(LibGit2.head_oid(repo)) @@ -404,6 +406,7 @@ function update(branch::AbstractString) end end end + stopupdate && break if haskey(avail,pkg) try Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])