Issue 1:
I understand that the package system is under heavy development, but I cannot install either Distributions nor Gadfly, because Pkg is finding dependencies that are not present in the .julia directory (nor anywhere else for that matter) and I haven't the foggiest about how to fix this because I don't know how the package system works without reading the code for it. It would be great if I didn't have to post on the mailing list asking how to resolve this issue, and there was a workaround that is documented somewhere in the Julia manual, not only for this issue but for any issue regarding packages that has come up since its inception. Somewhat of a cookbook for Pkg failures.

Issue 2:
Can pkg set a file lock of some sort so it can detect when it might have unfinished business (and possibly to protect against simultaneous access)? Would this be worthwhile?

Session history:

julia> load("pkg")

.... #adding lots of packages

julia> Pkg.add("ZMQ","Trie","Debug")
Installing Debug: v0.0.0
Cloning into 'Debug'...
remote: Counting objects: 1246, done.
remote: Compressing objects: 100% (444/444), done.
remote: Total 1246 (delta 793), reused 1230 (delta 780)
Receiving objects: 100% (1246/1246), 187.37 KiB, done.
Resolving deltas: 100% (793/793), done.
dup: Too many open files

$ # julia crashed

restart:

julia> load("pkg")

julia> Pkg.add("ZMQ","Trie","Debug")
package already required: VersionSet("ZMQ",[])
in anonymous at no file:98
in cd at file.jl:176
in cd_pkgdir at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:22
in add at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:91
in add at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:116

julia> Pkg.add("Trie","Debug")
package already required: VersionSet("Trie",[])
in anonymous at no file:98
in cd at file.jl:176
in cd_pkgdir at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:22
in add at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:91
in add at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:116

julia> Pkg.add("Debug")
package already required: VersionSet("Debug",[])
in anonymous at no file:98
in cd at file.jl:176
in cd_pkgdir at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:22
in add at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:91
in add at /Users/jameson/Documents/no-backup/julia/base/pkg.jl:116

but they don't seem to exist?

$ ls ~/.julia
ArgParse Color Debug FileFind METADATA Optim RDatasets TextWrap Winston
Cairo DataFrames FITSIO IniFile Named Options REQUIRE Tk

we find they aren't broken, just need to be restarted:

julia> Pkg.update()
Already up-to-date.
Warning: Possible conflict in library symbol floor
Warning: Possible conflict in library symbol sqrt
Installing Trie: v0.0.0
Cloning into 'Trie'...
Installing ZMQ: v0.0.0
Cloning into 'ZMQ'...
remote: Counting objects: 41, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 41 (delta 14), reused 30 (delta 6)
Receiving objects: 100% (41/41), 12.32 KiB, done.
Resolving deltas: 100% (14/14), done.

julia>

now everything is correct:

$ ls ~/.julia
ArgParse DataFrames FileFind Named RDatasets Tk ZMQ
Cairo Debug IniFile Optim REQUIRE Trie
Color FITSIO METADATA Options TextWrap Winston

Version 0.0.0+104039629.rdae2.dirty
Commit dae23a6824 (2012-12-09 02:32:55)*
(equivalent to commit fcaf0a0 in origin/master)