--- a/src/cmd/goinstall/main.go +++ b/src/cmd/goinstall/main.go @@ -21,6 +21,7 @@ import ( ) func usage() { + fmt.Fprintf(os.Stderr, "WARNING: Usage of goinstall is highly discouraged on Debian system. goinstall is not FHS friendly and it will possibly overwrite files from the package creating a highly unstable mess in /usr/lib/go. You have been warned!\n") fmt.Fprint(os.Stderr, "usage: goinstall importpath...\n") fmt.Fprintf(os.Stderr, "\tgoinstall -a\n") flag.PrintDefaults() @@ -43,6 +44,7 @@ var ( update = flag.Bool("u", false, "update already-downloaded packages") clean = flag.Bool("clean", false, "clean the package directory before installing") verbose = flag.Bool("v", false, "verbose") + installDeps = flag.Bool("d", false, "install package prerequisites") ) type status int // status for visited map @@ -189,7 +191,11 @@ func install(pkg, parent string) { } for _, p := range dirInfo.imports { if p != "C" { - install(p, pkg) + if *installDeps { + install(p, pkg) + } else { + visit[p] = done + } } } if dirInfo.pkgName == "main" { --- a/src/cmd/goinstall/doc.go +++ b/src/cmd/goinstall/doc.go @@ -4,6 +4,11 @@ /* +WARNING: Usage of goinstall is highly discouraged on Debian system. +goinstall is not FHS friendly and it will possibly overwrite files +from the package creating a highly unstable mess in /usr/lib/go. +You have been warned! + Goinstall is an experiment in automatic package installation. It installs packages, possibly downloading them from the internet. It maintains a list of public Go packages at http://godashboard.appspot.com/package. @@ -14,6 +19,7 @@ Usage: Flags and default settings: -a=false install all previously installed packages + -d=false install all package prerequisites (dangerous on Debian) -clean=false clean the package directory before installing -dashboard=true tally public packages on godashboard.appspot.com -log=true log installed packages to $GOROOT/goinstall.log for use by -a @@ -21,9 +27,9 @@ Flags and default settings: -v=false verbose operation Goinstall installs each of the packages identified on the command line. It -installs a package's prerequisites before trying to install the package -itself. Unless -log=false is specified, goinstall logs the import path of each -installed package to $GOROOT/goinstall.log for use by goinstall -a. +installs a package's prerequisites if given -d=true before trying to install +the package itself. Unless -log=false is specified, goinstall logs the import +path of each installed package to $GOROOT/goinstall.log for use by goinstall -a. If the -a flag is given, goinstall reinstalls all previously installed packages, reading the list from $GOROOT/goinstall.log. After updating to a