ruaur 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ruaur +19 -8
- data/lib/ruaur/pacman.rb +4 -0
- data/lib/ruaur.rb +17 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d91f9f2007c3c871c47ae345664c5cb9ce041048
|
4
|
+
data.tar.gz: 23639fc12e377e9c68b33bd6221ae09ebafc17c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e141fc80554db4a91b3072dd6f9fdd00d754775f50f63fbcf3ffa9b10a9b5d4a5b9580d901b3b05f51be302e0595394df068254bb91cfa1d44d386c4402ffb8
|
7
|
+
data.tar.gz: b9f129ec40899d191ee551469e4c4e8086f9f59a75d66a55fdce77f775a9046cb4c585ed2ea6ef24b357f9f6a6a5f1b08881b921c798da36fabb4f273458cdfb
|
data/bin/ruaur
CHANGED
@@ -7,16 +7,17 @@ require "ruaur"
|
|
7
7
|
class Flags
|
8
8
|
# Query
|
9
9
|
INFO = 1
|
10
|
+
OWNS = 2
|
10
11
|
|
11
12
|
# Remove
|
12
|
-
NOSAVE =
|
13
|
+
NOSAVE = 3
|
13
14
|
|
14
15
|
# Sync
|
15
|
-
CLEAN =
|
16
|
-
NAMES_ONLY =
|
17
|
-
NOCONFIRM =
|
18
|
-
SEARCH =
|
19
|
-
UPGRADE =
|
16
|
+
CLEAN = 4
|
17
|
+
NAMES_ONLY = 5
|
18
|
+
NOCONFIRM = 6
|
19
|
+
SEARCH = 7
|
20
|
+
UPGRADE = 8
|
20
21
|
end
|
21
22
|
|
22
23
|
class Operation
|
@@ -110,6 +111,14 @@ def parse(args)
|
|
110
111
|
options["flags"].push(Flags::INFO)
|
111
112
|
end
|
112
113
|
|
114
|
+
opts.on(
|
115
|
+
"-o",
|
116
|
+
"--owns",
|
117
|
+
"Search for packages that own the specified file(s)"
|
118
|
+
) do
|
119
|
+
options["flags"].push(Flags::OWNS)
|
120
|
+
end
|
121
|
+
|
113
122
|
opts.on("", "REMOVE_OPTIONS")
|
114
123
|
|
115
124
|
opts.on("-n", "--nosave", "Completely remove package") do
|
@@ -183,7 +192,8 @@ def validate(options)
|
|
183
192
|
case options["operation"]
|
184
193
|
when Operation::QUERY
|
185
194
|
flags = options["flags"].select do |flag|
|
186
|
-
flag != Flags::INFO
|
195
|
+
(flag != Flags::INFO) &&
|
196
|
+
(flag != Flags::OWNS)
|
187
197
|
end
|
188
198
|
return false if (!flags.empty?)
|
189
199
|
when Operation::REMOVE
|
@@ -241,7 +251,8 @@ begin
|
|
241
251
|
when Operation::QUERY
|
242
252
|
ruaur.query(
|
243
253
|
options["packages"],
|
244
|
-
options["flags"].include?(Flags::INFO)
|
254
|
+
options["flags"].include?(Flags::INFO),
|
255
|
+
options["flags"].include?(Flags::OWNS)
|
245
256
|
)
|
246
257
|
when Operation::REMOVE
|
247
258
|
ruaur.remove(
|
data/lib/ruaur/pacman.rb
CHANGED
@@ -99,6 +99,10 @@ class RuAUR::Pacman
|
|
99
99
|
return results
|
100
100
|
end
|
101
101
|
|
102
|
+
def query_owns(file_names)
|
103
|
+
return %x(#{@pac_nocolor} -Qo #{file_names})
|
104
|
+
end
|
105
|
+
|
102
106
|
def remove(pkg_names, nosave = false)
|
103
107
|
puts hilight_status("Removing #{pkg_names.join(" ")}...")
|
104
108
|
if (!nosave)
|
data/lib/ruaur.rb
CHANGED
@@ -57,19 +57,23 @@ class RuAUR
|
|
57
57
|
unlock
|
58
58
|
end
|
59
59
|
|
60
|
-
def query(pkg_names, info = false)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
60
|
+
def query(pkg_names, info = false, owns = false)
|
61
|
+
if (owns)
|
62
|
+
puts @pacman.query_owns(pkg_names.join(" "))
|
63
|
+
else
|
64
|
+
pkg_names.each do |pkg_name|
|
65
|
+
results = @pacman.query(pkg_name, info)
|
66
|
+
results.each do |name, details|
|
67
|
+
print "#{name} " if (!info)
|
68
|
+
puts details
|
69
|
+
puts if (info)
|
70
|
+
end
|
71
|
+
results = @aur.query(pkg_name, info)
|
72
|
+
results.each do |name, details|
|
73
|
+
print "#{name} " if (!info)
|
74
|
+
puts details
|
75
|
+
puts if (info)
|
76
|
+
end
|
73
77
|
end
|
74
78
|
end
|
75
79
|
end
|