Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cleanup output

  • Loading branch information...
commit b3c2c11df2e7892110ebd7a9cdbf2057b9ef15ba 1 parent 6efc149
Dave Reisner authored August 29, 2010

Showing 1 changed file with 11 additions and 9 deletions. Show diff stats Hide diff stats

  1. 20  gobble.go
20  gobble.go
@@ -78,8 +78,8 @@ func addPkgToMap(pkg *archpkg) {
78 78
   }
79 79
 }
80 80
 
81  
-func prune() int {
82  
-  count := 0
  81
+func prune() (int, int) {
  82
+  pkgCount, grpCount := 0, 0
83 83
 
84 84
   for _, group := range pkgList {
85 85
     groupSz := group.Len()
@@ -94,7 +94,7 @@ func prune() int {
94 94
 
95 95
       if *delete {
96 96
         if !*quiet {
97  
-          fmt.Println("Deleting " + fullpath)
  97
+          fmt.Println("Deleting " + filename)
98 98
         }
99 99
         err := os.Remove(fullpath)
100 100
         if err != nil {
@@ -103,16 +103,17 @@ func prune() int {
103 103
         }
104 104
       } else {
105 105
         if !*quiet {
106  
-          fmt.Println("Would delete: " + fullpath)
  106
+          fmt.Println("Would delete: " + filename)
107 107
         }
108 108
       }
109  
-      count++
  109
+      pkgCount++
110 110
 
111 111
       group.Remove(group.Front())
112 112
     }
  113
+    grpCount++
113 114
   }
114 115
 
115  
-  return count
  116
+  return grpCount, pkgCount
116 117
 }
117 118
 
118 119
 /* TODO: Reimplement alpm_pkg_vermp() */
@@ -170,13 +171,14 @@ func main() {
170 171
     fmt.Fprintln(os.Stderr, "error: No candidate package groups found. Are you sure this is a valid pacman cache?")
171 172
     os.Exit(0)
172 173
   default:
173  
-    fmt.Printf("%d candidate package groups found.\n", found)
  174
+    fmt.Printf("%d candidate package groups found in %s.\n", found, *cachePath)
174 175
   }
175 176
 
  177
+  g, p := prune()
176 178
   if *delete {
177  
-    fmt.Printf("%d packages pruned.\n", prune())
  179
+    fmt.Printf("%d files pruned from %d package groups.\n", p, g)
178 180
   } else {
179  
-    fmt.Printf("%d packages would be pruned.\n", prune())
  181
+    fmt.Printf("%d files would be pruned from %d package groups.\n", p, g)
180 182
   }
181 183
 
182 184
 }

0 notes on commit b3c2c11

Please sign in to comment.
Something went wrong with that request. Please try again.