Skip to content

Commit

Permalink
slightly more sensible cleaning notification
Browse files Browse the repository at this point in the history
  • Loading branch information
skelterjohn committed Dec 9, 2011
1 parent f9712f6 commit 7dbb7f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gb/gb.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var IncludeDir string
var GCArgs []string
var GLArgs []string
var PackagesBuilt int
var PackagesCleaned int
var PackagesInstalled int
var BrokenPackages int
var ListedTargets int
Expand Down Expand Up @@ -553,7 +554,7 @@ func RunGB() (err error) {
}
}
if Clean {
if PackagesBuilt == 0 {
if PackagesCleaned == 0 {
fmt.Printf("No mess to clean\n")
}
}
Expand Down
4 changes: 3 additions & 1 deletion gb/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ func (this *Package) CleanFiles() (err error) {

if Makefiles && this.HasMakefile {
MakeClean(this)
PackagesBuilt++
PackagesCleaned++
return
}

Expand Down Expand Up @@ -1129,6 +1129,7 @@ func (this *Package) CleanFiles() (err error) {
return
}
fmt.Printf("Cleaning %s\n", this.Dir)
PackagesCleaned++
for _, obj := range this.Objects {
if Verbose {
fmt.Printf(" Removing %s\n", obj)
Expand All @@ -1139,6 +1140,7 @@ func (this *Package) CleanFiles() (err error) {
fmt.Printf(" Removing %s\n", this.ResultPath)
}
err = os.Remove(this.ResultPath)

if this.IsCmd {
_, bres := path.Split(this.ResultPath)
bres = path.Join(this.Dir, bres)
Expand Down

0 comments on commit 7dbb7f5

Please sign in to comment.