Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg2 wip: package caching works; install, update and remove in progress.
- Loading branch information
1 parent
918df4f
commit df7a088
Showing
6 changed files
with
117 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Cache | ||
|
||
using Base.Git | ||
|
||
const cache = ".cache" | ||
|
||
function fetch(pkg::String, url::String, ver::VersionNumber, sha1::String) | ||
isdir(cache) || mkpath(cache) | ||
cd(cache) do | ||
if !isdir(pkg) | ||
run(`git clone -q --bare $url $pkg`) | ||
cd(pkg) do | ||
run(`git config --remove-section remote.origin`) | ||
end | ||
end | ||
cd(pkg) do | ||
run(`git fetch -q --tags $url`) | ||
Git.iscommit(sha1) || error("$pkg version $ver [$(sha1[1:8])] not found") | ||
end | ||
end | ||
nothing | ||
end | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters