From ea0a3f18f510a440fcd930b872dfe807a13a4677 Mon Sep 17 00:00:00 2001 From: Jiahao Chen Date: Wed, 6 May 2015 01:37:04 -0400 Subject: [PATCH] Pkg: Don't spawn git processes asynchronously This change significantly reduces the system overhead by spawning many git commands asynchronously. By running each git command sequentially, this change also restores Pkg.update() functionality to Mac OS X systems rendered unusable by #8601. --- base/pkg/entry.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base/pkg/entry.jl b/base/pkg/entry.jl index ac339f44bd884..2c9c52a52a824 100644 --- a/base/pkg/entry.jl +++ b/base/pkg/entry.jl @@ -254,18 +254,18 @@ function update(branch::AbstractString) end avail = Read.available() # this has to happen before computing free/fixed - @sync for pkg in filter!(Read.isinstalled,collect(keys(avail))) - @async Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]]) + for pkg in filter!(Read.isinstalled,collect(keys(avail))) + Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]]) end instd = Read.installed(avail) free = Read.free(instd) - @sync for (pkg,ver) in free - @async Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]]) + for (pkg,ver) in free + Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]]) end fixed = Read.fixed(avail,instd) - @sync for (pkg,ver) in fixed + for (pkg,ver) in fixed ispath(pkg,".git") || continue - @async begin + begin if Git.attached(dir=pkg) && !Git.dirty(dir=pkg) info("Updating $pkg...") @recover begin