summaryrefslogtreecommitdiff
path: root/src/cmd/goinstall/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/goinstall/main.go')
-rw-r--r--src/cmd/goinstall/main.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/cmd/goinstall/main.go b/src/cmd/goinstall/main.go
index 8fec8e312..6cd92907a 100644
--- a/src/cmd/goinstall/main.go
+++ b/src/cmd/goinstall/main.go
@@ -150,6 +150,7 @@ func install(pkg, parent string) {
// Check whether package is local or remote.
// If remote, download or update it.
var dir string
+ proot := gopath[0] // default to GOROOT
local := false
if strings.HasPrefix(pkg, "http://") {
fmt.Fprintf(os.Stderr, "%s: %s: 'http://' used in remote path, try '%s'\n", argv0, pkg, pkg[7:])
@@ -163,8 +164,9 @@ func install(pkg, parent string) {
dir = filepath.Join(root, filepath.FromSlash(pkg))
local = true
} else {
- var err os.Error
- dir, err = download(pkg)
+ proot = findPkgroot(pkg)
+ err := download(pkg, proot.srcDir())
+ dir = filepath.Join(proot.srcDir(), pkg)
if err != nil {
fmt.Fprintf(os.Stderr, "%s: %s: %s\n", argv0, pkg, err)
errors = true
@@ -192,18 +194,11 @@ func install(pkg, parent string) {
install(p, pkg)
}
}
- if dirInfo.pkgName == "main" {
- if !errors {
- fmt.Fprintf(os.Stderr, "%s: %s's dependencies are installed.\n", argv0, pkg)
- }
- errors = true
- visit[pkg] = done
- return
- }
// Install this package.
if !errors {
- if err := domake(dir, pkg, local); err != nil {
+ isCmd := dirInfo.pkgName == "main"
+ if err := domake(dir, pkg, proot, local, isCmd); err != nil {
fmt.Fprintf(os.Stderr, "%s: installing %s: %s\n", argv0, pkg, err)
errors = true
} else if !local && *logPkgs {