Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ddc2710d
Commit
ddc2710d
authored
Jan 05, 2011
by
Kyle Lemons
Committed by
Russ Cox
Jan 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goinstall: add -clean flag
R=adg, rsc CC=golang-dev
https://golang.org/cl/3821042
parent
c22c6dac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
src/cmd/goinstall/main.go
src/cmd/goinstall/main.go
+1
-0
src/cmd/goinstall/make.go
src/cmd/goinstall/make.go
+15
-6
No files found.
src/cmd/goinstall/main.go
View file @
ddc2710d
...
...
@@ -41,6 +41,7 @@ var (
reportToDashboard
=
flag
.
Bool
(
"dashboard"
,
true
,
"report public packages at "
+
dashboardURL
)
logPkgs
=
flag
.
Bool
(
"log"
,
true
,
"log installed packages to $GOROOT/goinstall.log for use by -a"
)
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"
)
)
...
...
src/cmd/goinstall/make.go
View file @
ddc2710d
...
...
@@ -17,18 +17,27 @@ import (
// For non-local packages or packages without Makefiles,
// domake generates a standard Makefile and passes it
// to make on standard input.
func
domake
(
dir
,
pkg
string
,
local
bool
)
os
.
Error
{
func
domake
(
dir
,
pkg
string
,
local
bool
)
(
err
os
.
Error
)
{
needMakefile
:=
true
if
local
{
_
,
err
:=
os
.
Stat
(
dir
+
"/Makefile"
)
if
err
==
nil
{
return
run
(
dir
,
nil
,
"gomake"
,
"install"
)
needMakefile
=
false
}
}
makefile
,
err
:=
makeMakefile
(
dir
,
pkg
)
if
err
!=
nil
{
return
err
cmd
:=
[]
string
{
"gomake"
}
var
makefile
[]
byte
if
needMakefile
{
if
makefile
,
err
=
makeMakefile
(
dir
,
pkg
);
err
!=
nil
{
return
err
}
cmd
=
append
(
cmd
,
"-f-"
)
}
if
*
clean
{
cmd
=
append
(
cmd
,
"clean"
)
}
return
run
(
dir
,
makefile
,
"gomake"
,
"-f-"
,
"install"
)
cmd
=
append
(
cmd
,
"install"
)
return
run
(
dir
,
makefile
,
cmd
...
)
}
// makeMakefile computes the standard Makefile for the directory dir
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment