pkgpurge 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pkgpurge/cli.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bf5c4b2f339a83d7bf9a16577c88031fd0d55238262f2141ab9b40f9a6acc62
|
4
|
+
data.tar.gz: 1395cfd8eaa07bbc9ac786b32475bbd77c394079352b4974713399dbb0cdcee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87f03716b54d99184056853fc17dd7180647f12a5b252bd9883c95c983c9af696099f5927480abc5be81dab0aef7d4733851dbb6cf3487dd79e41329bedd5384
|
7
|
+
data.tar.gz: 37ce6047f266a94eefe6a3a858deeca6d4c96f120a32f726c1322ffc626f5fde45a65215a72287c11e59c877e3665bbdc1cc4ee4014f3b11b0709bf09b457c22
|
data/lib/pkgpurge/cli.rb
CHANGED
@@ -3,6 +3,10 @@ require "thor"
|
|
3
3
|
|
4
4
|
module Pkgpurge
|
5
5
|
class CLI < Thor
|
6
|
+
def self.exit_on_failure
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
6
10
|
desc "ls PATH", "List entries for given receipt plist at PATH"
|
7
11
|
def ls(path)
|
8
12
|
root = Receipt.new(path).root
|
@@ -18,11 +22,15 @@ module Pkgpurge
|
|
18
22
|
def verify(path)
|
19
23
|
root = Receipt.new(path).root
|
20
24
|
|
25
|
+
valid = true
|
21
26
|
Entry.traverse_entry_with_path(root, "/") do |entry, path|
|
22
27
|
verify_entry(entry, path, options).each do |modification|
|
23
28
|
report path, *modification
|
29
|
+
valid = false
|
24
30
|
end
|
25
31
|
end
|
32
|
+
|
33
|
+
exit(false) unless valid
|
26
34
|
end
|
27
35
|
|
28
36
|
desc "ls-purge PATH", "List entries that can be purged for given receipt plist at PATH"
|
@@ -45,7 +53,8 @@ module Pkgpurge
|
|
45
53
|
|
46
54
|
def traverse_purge_entry_with_path(entry, parent_path, &block)
|
47
55
|
path = File.expand_path(File.join(parent_path, entry.name))
|
48
|
-
|
56
|
+
|
57
|
+
unless File.exists?(path) || File.symlink?(path)
|
49
58
|
return true
|
50
59
|
end
|
51
60
|
|
@@ -73,7 +82,7 @@ module Pkgpurge
|
|
73
82
|
def verify_entry(entry, path, options = {})
|
74
83
|
modifications = []
|
75
84
|
|
76
|
-
unless File.exists?(path)
|
85
|
+
unless File.exists?(path) || File.symlink?(path)
|
77
86
|
modifications << ["missing"]
|
78
87
|
return modifications
|
79
88
|
end
|