slack-utils 0.5.2 → 0.5.3
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.
- data/README.rdoc +1 -1
- data/bin/slf +9 -5
- data/bin/sll +9 -6
- data/lib/slackware/package.rb +16 -16
- data/lib/slackware/system.rb +1 -1
- data/lib/slackware/version.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
data/bin/slf
CHANGED
@@ -43,7 +43,15 @@ EOS
|
|
43
43
|
)
|
44
44
|
exit()
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
|
+
opts.parse!
|
48
|
+
|
49
|
+
if (ARGV.count == 0)
|
50
|
+
$stderr.write("ERROR: one of more file must be specified\n")
|
51
|
+
puts opts
|
52
|
+
exit 2
|
53
|
+
end
|
54
|
+
end
|
47
55
|
rescue OptionParser::InvalidOption => e
|
48
56
|
$stderr.write("ERROR: #{e.message}, see --help\n")
|
49
57
|
exit 1
|
@@ -53,10 +61,6 @@ if (ARGV.count > 0)
|
|
53
61
|
options[:all] = true
|
54
62
|
end
|
55
63
|
|
56
|
-
if (ARGV.count == 0)
|
57
|
-
Trollop::die("one or more files must be provided")
|
58
|
-
end
|
59
|
-
|
60
64
|
begin
|
61
65
|
print_package_searched_files(build_packages(options, []), ARGV)
|
62
66
|
rescue Interrupt
|
data/bin/sll
CHANGED
@@ -43,17 +43,20 @@ EOS
|
|
43
43
|
)
|
44
44
|
exit()
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
|
+
opts.parse!
|
48
|
+
|
49
|
+
if (options[:pkg].nil? && options[:Version].nil? && options[:arch].nil? && options[:build].nil? && options[:tag].nil? && not(options[:force]))
|
50
|
+
$stderr.write("ERROR: force me if you really want to see all files ...\n")
|
51
|
+
puts opts
|
52
|
+
exit 2
|
53
|
+
end
|
54
|
+
end
|
47
55
|
rescue OptionParser::InvalidOption => e
|
48
56
|
$stderr.write("ERROR: #{e.message}, see --help\n")
|
49
57
|
exit 1
|
50
58
|
end
|
51
59
|
|
52
|
-
if ((options.keys & %w{pkg Version arch build tag}.map {|a| :"#{a}" }).count == 0 && not(options[:force]))
|
53
|
-
$stderr.write("force me if you really want to see all files ...\nsee --help for more info\n")
|
54
|
-
exit 1
|
55
|
-
end
|
56
|
-
|
57
60
|
# handing through that we are listing owned files
|
58
61
|
options[:list_files] = true
|
59
62
|
|
data/lib/slackware/package.rb
CHANGED
@@ -54,8 +54,8 @@ module Slackware
|
|
54
54
|
|
55
55
|
# Accessor for the PACKAGE DESCRIPTION from the package file
|
56
56
|
def package_description
|
57
|
-
if not(
|
58
|
-
return
|
57
|
+
if not(self.package_description.nil?)
|
58
|
+
return self.package_description
|
59
59
|
end
|
60
60
|
|
61
61
|
f = File.open(self.path + '/' + self.fullname)
|
@@ -69,13 +69,13 @@ module Slackware
|
|
69
69
|
|
70
70
|
# Setter for the PACKAGE DESCRIPTION, in the event you are parsing a repo file
|
71
71
|
def package_description=(desc)
|
72
|
-
|
72
|
+
self.package_description = desc
|
73
73
|
end
|
74
74
|
|
75
75
|
# Accessor for the PACKAGE LOCATION from the package file
|
76
76
|
def package_location
|
77
|
-
if not(
|
78
|
-
return
|
77
|
+
if not(self.package_location.nil?)
|
78
|
+
return self.package_location
|
79
79
|
end
|
80
80
|
|
81
81
|
f = File.open(self.path + '/' + self.fullname)
|
@@ -88,13 +88,13 @@ module Slackware
|
|
88
88
|
|
89
89
|
# Setter for the PACKAGE LOCATION, in the event you are parsing a repo file
|
90
90
|
def package_location=(path)
|
91
|
-
|
91
|
+
self.package_location = path
|
92
92
|
end
|
93
93
|
|
94
94
|
# Accessor for the UNCOMPRESSED PACKAGE SIZE from the package file
|
95
95
|
def uncompressed_size
|
96
|
-
if not(
|
97
|
-
return
|
96
|
+
if not(self.uncompressed_size.nil?)
|
97
|
+
return self.uncompressed_size
|
98
98
|
end
|
99
99
|
|
100
100
|
f = File.open(self.path + '/' + self.fullname)
|
@@ -107,13 +107,13 @@ module Slackware
|
|
107
107
|
|
108
108
|
# Setter for the UNCOMPRESSED PACKAGE SIZE, in the event you are parsing a repo file
|
109
109
|
def uncompressed_size=(size)
|
110
|
-
|
110
|
+
self.uncompressed_size = size
|
111
111
|
end
|
112
112
|
|
113
113
|
# Accessor for the COMPRESSED PACKAGE SIZE from the package file
|
114
114
|
def compressed_size
|
115
|
-
if not(
|
116
|
-
return
|
115
|
+
if not(self.compressed_size.nil?)
|
116
|
+
return self.compressed_size
|
117
117
|
end
|
118
118
|
|
119
119
|
f = File.open(self.path + '/' + self.fullname)
|
@@ -126,14 +126,14 @@ module Slackware
|
|
126
126
|
|
127
127
|
# Setter for the COMPRESSED PACKAGE SIZE, in the event you are parsing a repo file
|
128
128
|
def compressed_size=(size)
|
129
|
-
|
129
|
+
self.compressed_size = size
|
130
130
|
end
|
131
131
|
|
132
132
|
# Accessor for the FILE LIST from the package file
|
133
133
|
# unless the :owned_files symbol is populated
|
134
134
|
def get_owned_files
|
135
|
-
if not(
|
136
|
-
return
|
135
|
+
if not(self.owned_files.nil?)
|
136
|
+
return self.owned_files
|
137
137
|
else
|
138
138
|
f = File.open(self.path + '/' + self.fullname)
|
139
139
|
files = f.drop_while {|l| not( l =~ /^FILE LIST:/) }[2..-1].map {|l| l.chomp }
|
@@ -144,8 +144,8 @@ module Slackware
|
|
144
144
|
|
145
145
|
# Set the file list in the package object in memory
|
146
146
|
def set_owned_files
|
147
|
-
if
|
148
|
-
|
147
|
+
if self.owned_files.nil?
|
148
|
+
self.owned_files = self.get_owned_files
|
149
149
|
return true
|
150
150
|
else
|
151
151
|
return false
|
data/lib/slackware/system.rb
CHANGED
@@ -138,7 +138,7 @@ module Slackware
|
|
138
138
|
file = file.sub(/^\//, "") # clean off the leading '/'
|
139
139
|
re = Regexp::new(/#{file}/)
|
140
140
|
pkgs.each {|pkg|
|
141
|
-
if (found = pkg.
|
141
|
+
if (found = pkg.get_owned_files.map {|f| f if f =~ re}.compact)
|
142
142
|
found.each {|f|
|
143
143
|
found_files << [pkg, f]
|
144
144
|
}
|
data/lib/slackware/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Vincent Batts
|
@@ -61,7 +61,7 @@ rdoc_options:
|
|
61
61
|
- --main=README.rdoc
|
62
62
|
- --line-numbers
|
63
63
|
- --inline-source
|
64
|
-
- --title=Slackware utils (slack-utils) 0.5.
|
64
|
+
- --title=Slackware utils (slack-utils) 0.5.3 Documentation
|
65
65
|
require_paths:
|
66
66
|
- lib
|
67
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|