slack-utils 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -72,7 +72,7 @@ See https://github.com/vbatts/slack-utils/wiki/Release-Notes
72
72
 
73
73
  See the system manual page slack-utils(8)
74
74
 
75
- === Using the library
75
+ === Using the API / library
76
76
 
77
77
  $ irb
78
78
  >> require 'rubygems'
data/bin/slo CHANGED
@@ -23,13 +23,14 @@ $PROGRAM_NAME = File.basename(__FILE__)
23
23
 
24
24
  require 'rubygems'
25
25
  require 'slackware/log'
26
+ require 'slackware/args'
26
27
  require 'slackware/utils'
27
28
 
28
29
  slog = Slackware::Log.instance
29
30
  slog.level = Slackware::Log::WARN
30
31
 
31
32
  options = Slackware::Args.parse(ARGV, [:debug])
32
- Slackware::Log.debug("options: %s" % options)
33
+ slog.debug("options: %s" % options)
33
34
 
34
35
  # update level if specified
35
36
  slog.level = Slackware::Log::DEBUG if options[:debug]
@@ -101,7 +101,7 @@ module Slackware
101
101
  # Slackware::System.upgrades("fart")
102
102
  # => []
103
103
  def self::upgrades(pkg)
104
- find_removed(pkg).select {|p| (p.name == pkg) }.sort {|a,b| a.upgrade_time <=> b.upgrade_time }
104
+ find_removed(pkg).select {|p| (p.name == pkg) && (p.upgrade_time) }.sort {|a,b| a.upgrade_time <=> b.upgrade_time }
105
105
  end
106
106
 
107
107
  # Return an Array of packages, that were installed after provided +time+
@@ -267,12 +267,12 @@ def find_orphaned_config_files
267
267
 
268
268
  # setup list of files to check whether they still exist on the filesystem
269
269
  files = []
270
- pkgs.map {|pkg| files << pkg[:files] }
271
- files.flatten!.uniq!
270
+ pkgs.map {|pkg| files += pkg[:files] }
271
+ files.uniq!
272
272
 
273
273
  orphaned_config_files = []
274
274
  files.each {|file|
275
- if (File.exist?("/" + file))
275
+ if (File.exist?(File.join(Slackware::Paths.root_dir(),file)))
276
276
  orphaned_config_files << file
277
277
  end
278
278
  }
@@ -28,7 +28,7 @@ module Slackware
28
28
  rescue
29
29
  nil
30
30
  end
31
- UTILS_VERSION = "0.7.1"
31
+ UTILS_VERSION = "0.7.2"
32
32
  end
33
33
 
34
34
  # vim : set sw=2 sts=2 et :
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-31 00:00:00.000000000 Z
12
+ date: 2012-02-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! " slack-utils is a means by which to access \npackage information on
15
15
  the Slackware Linux OS. \nSee the examples/ for more information.\n "
@@ -59,7 +59,7 @@ rdoc_options:
59
59
  - --main=README.rdoc
60
60
  - --line-numbers
61
61
  - --inline-source
62
- - --title=Slackware utils (slack-utils) 0.7.1 Documentation
62
+ - --title=Slackware utils (slack-utils) 0.7.2 Documentation
63
63
  require_paths:
64
64
  - lib
65
65
  required_ruby_version: !ruby/object:Gem::Requirement