pkgpurge 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pkgpurge/cli.rb +11 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0355e90ba986eb91079edf55712889ed302ad975279ef1a98fcc4157b1f7f892
4
- data.tar.gz: bf9c5cb2802d2abc9ed03d77636786019df095a7ccb558bb4b497d1a5e25fcc6
3
+ metadata.gz: 0bf5c4b2f339a83d7bf9a16577c88031fd0d55238262f2141ab9b40f9a6acc62
4
+ data.tar.gz: 1395cfd8eaa07bbc9ac786b32475bbd77c394079352b4974713399dbb0cdcee3
5
5
  SHA512:
6
- metadata.gz: 5f344569d473bef8598ca5a33e9a4124ec111a237599cf5deeebc26185970e7cfa86e9d905b3d9ac50824adedb53c5234b3e15a5c6f6714e9753b6c86a27b4f0
7
- data.tar.gz: 60f794319d6e3e804236fdd3a93438678f48cce7b8f905ae5fc3ce7303109e236c397cd74ac179a6d863c397050dff80e7e3115385606bf572094fbaa7a4cf48
6
+ metadata.gz: 87f03716b54d99184056853fc17dd7180647f12a5b252bd9883c95c983c9af696099f5927480abc5be81dab0aef7d4733851dbb6cf3487dd79e41329bedd5384
7
+ data.tar.gz: 37ce6047f266a94eefe6a3a858deeca6d4c96f120a32f726c1322ffc626f5fde45a65215a72287c11e59c877e3665bbdc1cc4ee4014f3b11b0709bf09b457c22
@@ -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
- unless File.exists?(path)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkgpurge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshimasa Niwa