Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 Goinstall is an experiment in automatic package installation. | 6 Goinstall is an experiment in automatic package installation. |
7 It installs packages, possibly downloading them from the internet. | 7 It installs packages, possibly downloading them from the internet. |
8 It maintains a list of public Go packages at http://godashboard.appspot.com/pack age. | 8 It maintains a list of public Go packages at |
9 http://godashboard.appspot.com/package. | |
9 | 10 |
10 Usage: | 11 Usage: |
11 goinstall [flags] importpath... | 12 goinstall [flags] importpath... |
12 goinstall [flags] -a | 13 goinstall [flags] -a |
13 | 14 |
14 Flags and default settings: | 15 Flags and default settings: |
15 -a=false install all previously installed packages | 16 -a=false install all previously installed packages |
16 -clean=false clean the package directory before installing | 17 -clean=false clean the package directory before installing |
17 -dashboard=true tally public packages on godashboard.appspot.com | 18 -dashboard=true tally public packages on godashboard.appspot.com |
18 -install=true build and install the package and its dependencies | 19 -install=true build and install the package and its dependencies |
(...skipping 22 matching lines...) Expand all Loading... | |
41 to update, recompile, and reinstall all goinstalled packages. | 42 to update, recompile, and reinstall all goinstalled packages. |
42 | 43 |
43 The source code for a package with import path foo/bar is expected | 44 The source code for a package with import path foo/bar is expected |
44 to be in the directory $GOROOT/src/pkg/foo/bar/ or $GOPATH/src/foo/bar/. | 45 to be in the directory $GOROOT/src/pkg/foo/bar/ or $GOPATH/src/foo/bar/. |
45 See "The GOPATH Environment Variable" for more about GOPATH. | 46 See "The GOPATH Environment Variable" for more about GOPATH. |
46 | 47 |
47 By default, goinstall prints output only when it encounters an error. | 48 By default, goinstall prints output only when it encounters an error. |
48 The -v flag causes goinstall to print information about packages | 49 The -v flag causes goinstall to print information about packages |
49 being considered and installed. | 50 being considered and installed. |
50 | 51 |
51 Goinstall does not use make. Makefiles are ignored by goinstall. | 52 Goinstall ignores Makefiles. |
52 | 53 |
53 | 54 |
54 Remote Repositories | 55 Remote Repositories |
55 | 56 |
56 If a package import path refers to a remote repository, goinstall will | 57 If a package import path refers to a remote repository, goinstall will |
57 download the code if necessary. | 58 download the code if necessary. |
58 | 59 |
59 An import path may refer to an arbitrary source repository by a suffix | 60 Goinstall recognizes packages from a few common code hosting sites: |
60 denoting the version control system. The supported VCSes and their | |
61 respective suffixes are: | |
62 | |
63 » Bazaar .bzr | |
64 » Git .git | |
65 » Mercurial .hg | |
66 » Subversion .svn | |
67 | |
68 Some examples: | |
69 | |
70 » To import the package at the root of a Mercurial repo at | |
71 » "http://example.org/user/project", use this statement: | |
72 | |
73 » » import "example.org/user/project.hg" | |
74 | |
75 » Or, the package foo/bar inside the Git repo at | |
76 » "git://example.com/repo.git" or "http://example.com/repo.git": | |
77 | |
78 » » import "example.com/repo.git/foo/bar" | |
79 | |
80 Goinstall also supports a few code hosting sites. | |
quantumfyre
2011/06/21 20:38:25
"Goinstall also supports a few code hosting sites
| |
81 Packages at one of these sites must not include the VCS suffix. | |
quantumfyre
2011/06/21 20:38:25
s/one/any/ ?
| |
82 The recognized code hosting sites are: | |
83 | 61 |
84 BitBucket (Mercurial) | 62 BitBucket (Mercurial) |
85 | 63 |
86 import "bitbucket.org/user/project" | 64 import "bitbucket.org/user/project" |
87 import "bitbucket.org/user/project/sub/directory" | 65 import "bitbucket.org/user/project/sub/directory" |
88 | 66 |
89 GitHub (Git) | 67 GitHub (Git) |
90 | 68 |
91 import "github.com/user/project" | 69 import "github.com/user/project" |
92 import "github.com/user/project/sub/directory" | 70 import "github.com/user/project/sub/directory" |
93 | 71 |
94 Google Code Project Hosting (Mercurial, Subversion) | 72 Google Code Project Hosting (Mercurial, Subversion) |
95 | 73 |
96 import "project.googlecode.com/hg" | 74 import "project.googlecode.com/hg" |
97 import "project.googlecode.com/hg/sub/directory" | 75 import "project.googlecode.com/hg/sub/directory" |
98 | 76 |
99 import "project.googlecode.com/svn/trunk" | 77 import "project.googlecode.com/svn/trunk" |
100 import "project.googlecode.com/svn/trunk/sub/directory" | 78 import "project.googlecode.com/svn/trunk/sub/directory" |
101 | 79 |
102 Launchpad (Bazaar) | 80 Launchpad (Bazaar) |
103 | 81 |
104 import "launchpad.net/project" | 82 import "launchpad.net/project" |
105 import "launchpad.net/project/series" | 83 import "launchpad.net/project/series" |
106 import "launchpad.net/project/series/sub/directory" | 84 import "launchpad.net/project/series/sub/directory" |
107 | 85 |
108 import "launchpad.net/~user/project/branch" | 86 import "launchpad.net/~user/project/branch" |
109 import "launchpad.net/~user/project/branch/sub/directory" | 87 import "launchpad.net/~user/project/branch/sub/directory" |
110 | 88 |
111 | |
112 If the destination directory (e.g., $GOROOT/src/pkg/bitbucket.org/user/project) | 89 If the destination directory (e.g., $GOROOT/src/pkg/bitbucket.org/user/project) |
113 already exists and contains an appropriate checkout, goinstall will not | 90 already exists and contains an appropriate checkout, goinstall will not |
114 attempt to fetch updates. The -u flag changes this behavior, | 91 attempt to fetch updates. The -u flag changes this behavior, |
115 causing goinstall to update all remote packages encountered during | 92 causing goinstall to update all remote packages encountered during |
116 the installation. | 93 the installation. |
117 | 94 |
118 When downloading or updating, goinstall first looks for a tag or branch | 95 When downloading or updating, goinstall first looks for a tag or branch |
119 named "release". If there is one, it uses that version of the code. | 96 named "release". If there is one, it uses that version of the code. |
120 Otherwise it uses the default version selected by the version control | 97 Otherwise it uses the default version selected by the version control |
121 system, typically HEAD for git, tip for Mercurial. | 98 system, typically HEAD for git, tip for Mercurial. |
122 | 99 |
123 After a successful download and installation of a publicly accessible | 100 After a successful download and installation of one of these import paths, |
124 remote package, goinstall reports the installation to godashboard.appspot.com, | 101 goinstall reports the installation to godashboard.appspot.com, which |
125 which increments a count associated with the package and the time | 102 increments a count associated with the package and the time of its most |
126 of its most recent installation. This mechanism powers the package list | 103 recent installation. This mechanism powers the package list at |
127 at http://godashboard.appspot.com/package, allowing Go programmers | 104 http://godashboard.appspot.com/package, allowing Go programmers to learn about |
128 to learn about popular packages that might be worth looking at. | 105 popular packages that might be worth looking at.» |
129 The -dashboard=false flag disables this reporting. | 106 The -dashboard=false flag disables this reporting. |
107 | |
108 For code hosted on other servers, goinstall recognizes the general form | |
109 | |
110 repository.vcs/path | |
111 | |
112 as denoting the given repository, with or without the .vcs suffix, using | |
113 the named version control system, and then the path inside that repository. | |
114 The supported version control systems are: | |
115 | |
116 Bazaar .bzr | |
117 Git .git | |
118 Mercurial .hg | |
119 Subversion .svn | |
120 | |
121 For example,· | |
122 | |
123 import "example.org/user/foo.hg" | |
124 | |
125 denotes the root directory of the Mercurial repository at example.org/user/foo | |
126 or foo.hg, and | |
127 | |
128 import "example.org/repo.git/foo/bar" | |
129 | |
130 denotes the foo/bar directory of the Git repository at example.com/repo or | |
131 repo.git. | |
132 | |
133 When a version control system supports multiple protocols, goinstall tries each | |
134 in turn. | |
135 For example, for Git it tries git://, then https://, then http://. | |
130 | 136 |
131 | 137 |
132 The GOPATH Environment Variable | 138 The GOPATH Environment Variable |
133 | 139 |
134 GOPATH may be set to a colon-separated list of paths inside which Go code, | 140 GOPATH may be set to a colon-separated list of paths inside which Go code, |
135 package objects, and executables may be found. | 141 package objects, and executables may be found. |
136 | 142 |
137 Set a GOPATH to use goinstall to build and install your own code and | 143 Set a GOPATH to use goinstall to build and install your own code and |
138 external libraries outside of the Go tree (and to avoid writing Makefiles). | 144 external libraries outside of the Go tree (and to avoid writing Makefiles). |
139 | 145 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 The following commands would build our example packages: | 182 The following commands would build our example packages: |
177 | 183 |
178 goinstall /home/user/gocode/src/foo/bar # build and install foo/bar | 184 goinstall /home/user/gocode/src/foo/bar # build and install foo/bar |
179 cd /home/user/gocode/src/foo | 185 cd /home/user/gocode/src/foo |
180 goinstall ./bar # build and install foo/bar (again) | 186 goinstall ./bar # build and install foo/bar (again) |
181 cd qux | 187 cd qux |
182 goinstall . # build and install foo/qux | 188 goinstall . # build and install foo/qux |
183 | 189 |
184 */ | 190 */ |
185 package documentation | 191 package documentation |
LEFT | RIGHT |