evaryont-arson 2.0.2 → 2.1.1
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/PKGBUILD +2 -2
- data/README.mkd +14 -15
- data/VERSION.yml +2 -2
- data/arson.gemspec +5 -6
- data/bin/arson +48 -25
- data/lib/arson/colorful.rb +1 -1
- data/lib/arson/config.rb +27 -0
- data/lib/arson/download.rb +10 -8
- data/lib/arson/version.rb +1 -1
- data/lib/arson.rb +5 -6
- metadata +5 -4
data/PKGBUILD
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Contributor: Colin 'Evaryont' Shea <evaryont@saphrix.com>
|
2
2
|
pkgname=arson
|
3
|
-
pkgver=2.
|
3
|
+
pkgver=2.1.1
|
4
4
|
pkgrel=1
|
5
5
|
pkgdesc="The HOT AUR search helper!"
|
6
6
|
arch=(any)
|
@@ -11,7 +11,7 @@ makedepends=(rubygems)
|
|
11
11
|
filename="evaryont-$pkgname-$pkgver.gem"
|
12
12
|
source=(http://gems.github.com/gems/$filename)
|
13
13
|
noextract=($filename)
|
14
|
-
md5sums=('
|
14
|
+
md5sums=('f509e388af796c211e53266a5fb34114')
|
15
15
|
|
16
16
|
build() {
|
17
17
|
cd $srcdir
|
data/README.mkd
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This is arson 2.0, the hot AUR search helper!
|
2
2
|
|
3
|
-
There is 3
|
3
|
+
There is 3 functions of arson:
|
4
4
|
|
5
5
|
* Searching
|
6
6
|
* Downloading
|
@@ -27,25 +27,24 @@ results to you, in color.
|
|
27
27
|
|
28
28
|
### Downloading
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
To download a package, pass "-d" to arson. Any other arguments will be converted
|
31
|
+
into a single string (space separated) and arson will try to download a package
|
32
|
+
with that exact name. e.g.:
|
33
|
+
arson -d arson # Downloads the package "arson"
|
34
|
+
arson -d pacman color # Downloads the package "pacman color"
|
35
|
+
arson won't perform any clean up on the passed parameters, so (using the 2nd
|
36
|
+
example) arson will try to find the 'pacman color' package while you probably
|
37
|
+
meant the 'pacman-color' package.
|
35
38
|
|
36
39
|
-----
|
37
40
|
|
38
41
|
### Updating
|
39
42
|
|
40
|
-
If you pass
|
41
|
-
|
42
|
-
|
43
|
+
If you pass -u to arson, it will search through the locally installed foreign
|
44
|
+
packages (as reported by `pacman -Qm') and return a list of possible updates
|
45
|
+
available in the AUR.
|
43
46
|
|
44
47
|
-----
|
45
48
|
|
46
|
-
You can not pass anything to arson to get a quick summary of
|
47
|
-
|
48
|
-
|
49
|
-
(ps: Yes, I did report arson as dead, and within the hour restart development
|
50
|
-
on it. I'm crazy like that, I guess. Also, Daenyth and rson wanted me to
|
51
|
-
continue. Yay having people who actually like my software!)
|
49
|
+
You can not pass anything or pass -h or --help to arson to get a quick summary of
|
50
|
+
these options.
|
data/VERSION.yml
CHANGED
data/arson.gemspec
CHANGED
@@ -2,26 +2,25 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{arson}
|
5
|
-
s.version = "2.
|
5
|
+
s.version = "2.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Colin 'Evaryont' Shea"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-06-16}
|
10
10
|
s.default_executable = %q{arson}
|
11
11
|
s.description = %q{The HOT AUR search helper}
|
12
12
|
s.email = %q{evaryont@saphrix.com}
|
13
13
|
s.executables = ["arson"]
|
14
|
-
s.files = ["PKGBUILD", "README.mkd", "Rakefile", "VERSION.yml", "arson.gemspec", "bin/arson", "lib/arson.rb", "lib/arson/colorful.rb", "lib/arson/download.rb", "lib/arson/search.rb", "lib/arson/upgrade.rb", "lib/arson/version.rb"]
|
15
|
-
s.has_rdoc = true
|
14
|
+
s.files = ["PKGBUILD", "README.mkd", "Rakefile", "VERSION.yml", "arson.gemspec", "bin/arson", "lib/arson.rb", "lib/arson/colorful.rb", "lib/arson/config.rb", "lib/arson/download.rb", "lib/arson/search.rb", "lib/arson/upgrade.rb", "lib/arson/version.rb"]
|
16
15
|
s.homepage = %q{http://evaryont.github.com/arson/}
|
17
16
|
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
|
18
17
|
s.require_paths = ["lib"]
|
19
|
-
s.rubygems_version = %q{1.3.
|
18
|
+
s.rubygems_version = %q{1.3.3}
|
20
19
|
s.summary = %q{The HOT AUR search helper}
|
21
20
|
|
22
21
|
if s.respond_to? :specification_version then
|
23
22
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
-
s.specification_version =
|
23
|
+
s.specification_version = 3
|
25
24
|
|
26
25
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
26
|
s.add_runtime_dependency(%q<json>, [">= 1.1.3"])
|
data/bin/arson
CHANGED
@@ -4,34 +4,43 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
4
4
|
|
5
5
|
require 'arson'
|
6
6
|
require 'arson/colorful'
|
7
|
+
require 'optparse'
|
7
8
|
|
9
|
+
Arson::Config.write unless File.exists? Arson::Config::FILE_PATH
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
puts Arson.colorful(:italic, " #{Arson::PROGRAM} pacman")
|
13
|
-
puts ""
|
14
|
-
puts "If you want to download a package, run #{Arson::PROGRAM} as such:"
|
15
|
-
puts Arson.colorful(:italic, " #{Arson::PROGRAM} aur/arson")
|
16
|
-
puts "(note: you can include the -category bit if you wish)"
|
17
|
-
puts ""
|
18
|
-
puts "Passing '?' to arson will cause it to check for any upgrades"
|
19
|
-
exit 1
|
20
|
-
end
|
11
|
+
options = {:download => 0}
|
12
|
+
opts = OptionParser.new do |opts|
|
13
|
+
opts.banner = "Usage: arson [options]"
|
21
14
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
15
|
+
opts.on("-d", "--download", "Download the exact package name", "Repeating this will download other depenedencies in AUR") do
|
16
|
+
options[:download] += 1
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("-u", "--upgrade", "Check for upgrades") do
|
20
|
+
options[:upgrade] = true
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
24
|
+
puts opts
|
27
25
|
exit 0
|
28
|
-
|
29
|
-
|
26
|
+
end
|
27
|
+
|
28
|
+
opts.on_tail("--version", "Show version") do
|
29
|
+
puts "arson v#{Arson::VERSION.join('.')}"
|
30
|
+
puts "Copyright (C) 2008 Colin Shea <colin@evaryont.me>"
|
31
|
+
puts "Licensed under the GPLv3, all rights reserved"
|
30
32
|
exit 0
|
31
33
|
end
|
34
|
+
|
32
35
|
end
|
36
|
+
ARGV.empty? ? opts.parse!(["-h"]) : opts.parse!(ARGV)
|
33
37
|
|
34
|
-
if ARGV.
|
38
|
+
if options[:download] > 0 and ARGV.empty?
|
39
|
+
warn "Missing names of packages to download!"
|
40
|
+
exit 1
|
41
|
+
end
|
42
|
+
|
43
|
+
if options[:upgrade]
|
35
44
|
print "Checking for upgrades..."
|
36
45
|
$stdout.flush
|
37
46
|
upgrades = Arson.check_upgrades
|
@@ -39,12 +48,24 @@ if ARGV.to_s =~ /\?/
|
|
39
48
|
print "\n"
|
40
49
|
$stdout.flush
|
41
50
|
upgrades.each do |line, new_version|
|
42
|
-
puts "#{line.strip} #{Arson
|
51
|
+
puts "#{line.strip} #{Arson.colorful("Green", new_version)}"
|
43
52
|
end
|
44
53
|
else
|
45
54
|
puts "Nothing to update"
|
46
55
|
end
|
47
56
|
exit 0
|
57
|
+
elsif options[:download] > 0
|
58
|
+
exit_code = 0
|
59
|
+
ARGV.each do |pkg|
|
60
|
+
if pkg = Arson.find_exact(pkg)
|
61
|
+
puts "Downloading #{pkg['Name']}..."
|
62
|
+
Arson.download(pkg)
|
63
|
+
else
|
64
|
+
warn "No such package '#{pkg}'"
|
65
|
+
exit_code = 1
|
66
|
+
end
|
67
|
+
end
|
68
|
+
exit exit_code
|
48
69
|
end
|
49
70
|
|
50
71
|
packages = Arson.search(ARGV)
|
@@ -70,8 +91,10 @@ elsif packages.length == 1
|
|
70
91
|
exit 0
|
71
92
|
end
|
72
93
|
|
73
|
-
if
|
74
|
-
|
75
|
-
|
76
|
-
|
94
|
+
if Arson::Config["run-pacman"]
|
95
|
+
if File.exists? "/usr/bin/pacman-color" and Arson::Config["color"]
|
96
|
+
exec "/usr/bin/pacman-color -Ss #{ARGV.join(' ')}"
|
97
|
+
else
|
98
|
+
exec "/usr/bin/pacman -Ss #{ARGV.join(' ')}"
|
99
|
+
end
|
77
100
|
end
|
data/lib/arson/colorful.rb
CHANGED
data/lib/arson/config.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
class Arson
|
4
|
+
module Config
|
5
|
+
|
6
|
+
# The location of the configuration file (hard coded for now)
|
7
|
+
FILE_PATH = File.expand_path(File.join("~", ".arson.yaml"))
|
8
|
+
# The loaded configuration
|
9
|
+
LOADED_YAML = File.exists?(FILE_PATH) ? open(FILE_PATH) {|f| YAML::load(f) } : {}
|
10
|
+
# Default configuration values
|
11
|
+
DEFAULTS = {"dir" => File.expand_path("~"), "pacman" => true, "color" => true}
|
12
|
+
# Merged values representing a combination of the user's choices
|
13
|
+
# and the defaults
|
14
|
+
MERGED = LOADED_YAML ? DEFAULTS.merge(LOADED_YAML) : DEFAULTS
|
15
|
+
|
16
|
+
# Returns the value for that configuration option (as a string)
|
17
|
+
def self.[](option)
|
18
|
+
MERGED[option.to_s]
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.write
|
22
|
+
open(FILE_PATH, "w") do |file|
|
23
|
+
file.write(DEFAULTS.to_yaml)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/arson/download.rb
CHANGED
@@ -20,16 +20,18 @@ class Arson
|
|
20
20
|
# After the file is downloaded, it is attempted to be unpacked using
|
21
21
|
# tar and gunzip formats.
|
22
22
|
def real_download(url)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
Dir.chdir(Arson::Config["dir"]) do
|
24
|
+
open(url) do |tar|
|
25
|
+
# Write the stream to a file, b (binary) is JIC
|
26
|
+
File.open(File.basename(url), "wb") do |file|
|
27
|
+
file.write(tar.read)
|
28
|
+
end
|
27
29
|
end
|
30
|
+
tgz = Zlib::GzipReader.new(File.open(File.basename(url), 'rb'))
|
31
|
+
# Extract pkg.tar.gz to `pwd`, instead of `pwd`/pkg
|
32
|
+
Archive::Tar::Minitar.unpack(tgz, Dir.pwd)
|
33
|
+
FileUtils.mv File.basename(url), File.join(Dir.pwd, File.basename(url)[0..-8])
|
28
34
|
end
|
29
|
-
tgz = Zlib::GzipReader.new(File.open(File.basename(url), 'rb'))
|
30
|
-
# Extract pkg.tar.gz to `pwd`, instead of `pwd`/pkg
|
31
|
-
Archive::Tar::Minitar.unpack(tgz, Dir.pwd)
|
32
|
-
FileUtils.mv File.basename(url), File.join(Dir.pwd, File.basename(url)[0..-8])
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
data/lib/arson/version.rb
CHANGED
data/lib/arson.rb
CHANGED
@@ -7,6 +7,7 @@ require 'facets/minitar'
|
|
7
7
|
require 'facets/version'
|
8
8
|
|
9
9
|
require 'arson/version'
|
10
|
+
require 'arson/config'
|
10
11
|
require 'arson/search'
|
11
12
|
require 'arson/download'
|
12
13
|
require 'arson/upgrade'
|
@@ -18,6 +19,7 @@ class Arson
|
|
18
19
|
Categories = %w{nil nil daemons devel editors emulators games gnome
|
19
20
|
i18n kde lib modules multimedia network office
|
20
21
|
science system x11 xfce kernels}
|
22
|
+
|
21
23
|
# Defaults from pacman-color
|
22
24
|
Colors = {"Magenta" => [:bold, :magenta],
|
23
25
|
"White" => [:bold],
|
@@ -29,14 +31,11 @@ class Arson
|
|
29
31
|
# And support for user modifications. Note that inline comments (ie
|
30
32
|
# "White = gray # blah blah") aren't supported and cause this to crash
|
31
33
|
Colors.merge!( Hash[ open("/etc/pacman.d/color.conf").readlines.map(&:strip).reject do |line|
|
32
|
-
line=~
|
34
|
+
line=~ /^#/ || line=~ /^$/
|
33
35
|
end.map do |line|
|
34
|
-
|
36
|
+
array = line.split("=").map(&:strip)
|
37
|
+
[a[0], a[1].sub(/intensive/, "bold").split.map(&:to_sym)]
|
35
38
|
end ] ) if File.exists? "/etc/pacman.d/color.conf"
|
36
39
|
|
37
40
|
PROGRAM = File.basename($0)
|
38
|
-
|
39
|
-
# These will possibly be redefined later.
|
40
|
-
ASCII_X = '✘'
|
41
|
-
ASCII_CHECK = '✔'
|
42
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evaryont-arson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin 'Evaryont' Shea
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-16 00:00:00 -07:00
|
13
13
|
default_executable: arson
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -49,11 +49,12 @@ files:
|
|
49
49
|
- bin/arson
|
50
50
|
- lib/arson.rb
|
51
51
|
- lib/arson/colorful.rb
|
52
|
+
- lib/arson/config.rb
|
52
53
|
- lib/arson/download.rb
|
53
54
|
- lib/arson/search.rb
|
54
55
|
- lib/arson/upgrade.rb
|
55
56
|
- lib/arson/version.rb
|
56
|
-
has_rdoc:
|
57
|
+
has_rdoc: false
|
57
58
|
homepage: http://evaryont.github.com/arson/
|
58
59
|
post_install_message:
|
59
60
|
rdoc_options:
|
@@ -78,7 +79,7 @@ requirements: []
|
|
78
79
|
rubyforge_project:
|
79
80
|
rubygems_version: 1.2.0
|
80
81
|
signing_key:
|
81
|
-
specification_version:
|
82
|
+
specification_version: 3
|
82
83
|
summary: The HOT AUR search helper
|
83
84
|
test_files: []
|
84
85
|
|