Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
546c78b7
Commit
546c78b7
authored
Jun 28, 2011
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder: minor fixes
R=golang-dev, gri, bradfitz CC=golang-dev
https://golang.org/cl/4634050
parent
6282292f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
package.go
misc/dashboard/builder/package.go
+13
-6
No files found.
misc/dashboard/builder/package.go
View file @
546c78b7
...
...
@@ -10,7 +10,8 @@ import (
"go/token"
"log"
"os"
"path"
"path/filepath"
"strings"
)
func
(
b
*
Builder
)
buildPackages
(
workpath
string
,
hash
string
)
os
.
Error
{
...
...
@@ -19,8 +20,8 @@ func (b *Builder) buildPackages(workpath string, hash string) os.Error {
return
err
}
for
_
,
p
:=
range
pkgs
{
goroot
:=
path
.
Join
(
workpath
,
"go"
)
goinstall
:=
path
.
Join
(
goroot
,
"bin"
,
"goinstall"
)
goroot
:=
file
path
.
Join
(
workpath
,
"go"
)
goinstall
:=
file
path
.
Join
(
goroot
,
"bin"
,
"goinstall"
)
envv
:=
append
(
b
.
envv
(),
"GOROOT="
+
goroot
)
// goinstall
...
...
@@ -29,10 +30,10 @@ func (b *Builder) buildPackages(workpath string, hash string) os.Error {
log
.
Printf
(
"goinstall %v: %v"
,
p
,
err
)
continue
}
built
:=
code
!
=
0
built
:=
code
=
=
0
// get doc comment from package source
info
,
err
:=
packageComment
(
p
,
path
.
Join
(
goroot
,
"pkg"
,
p
))
info
,
err
:=
packageComment
(
p
,
file
path
.
Join
(
goroot
,
"pkg"
,
p
))
if
err
!=
nil
{
log
.
Printf
(
"goinstall %v: %v"
,
p
,
err
)
}
...
...
@@ -46,9 +47,15 @@ func (b *Builder) buildPackages(workpath string, hash string) os.Error {
return
nil
}
func
isGoFile
(
fi
*
os
.
FileInfo
)
bool
{
return
fi
.
IsRegular
()
&&
// exclude directories
!
strings
.
HasPrefix
(
fi
.
Name
,
"."
)
&&
// ignore .files
filepath
.
Ext
(
fi
.
Name
)
==
".go"
}
func
packageComment
(
pkg
,
pkgpath
string
)
(
info
string
,
err
os
.
Error
)
{
fset
:=
token
.
NewFileSet
()
pkgs
,
err
:=
parser
.
ParseDir
(
fset
,
pkgpath
,
nil
,
parser
.
PackageClauseOnly
|
parser
.
ParseComments
)
pkgs
,
err
:=
parser
.
ParseDir
(
fset
,
pkgpath
,
isGoFile
,
parser
.
PackageClauseOnly
|
parser
.
ParseComments
)
if
err
!=
nil
{
return
}
...
...
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