automateit 0.71031.1 → 0.71031.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.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,13 @@
1
+ 0.71031.2:
2
+ Date: Wed, 31 Oct 2007 23:48:41 -0700
3
+ Desc:
4
+ - (+) Added PackageManager::PEAR and PackageManager::PECL, graciously contributed by David Brewer.
5
+
6
+ 0.71031.1:
7
+ Date: Wed, 31 Oct 2007 13:15:30 -0700
8
+ Desc:
9
+ - (%) Fixed bug in EditSession methods, these weren't escaping regular expression characters in strings. Refactored some of these methods for clarity.
10
+
1
11
  0.71031:
2
12
  Date: Wed, 31 Oct 2007 02:58:58 -0700
3
13
  Desc:
@@ -240,3 +240,5 @@ require 'automateit/package_manager/yum'
240
240
  require 'automateit/package_manager/gem'
241
241
  require 'automateit/package_manager/egg'
242
242
  require 'automateit/package_manager/portage'
243
+ require 'automateit/package_manager/pear'
244
+ require 'automateit/package_manager/pecl'
@@ -0,0 +1,89 @@
1
+ # == PackageManager::PEAR
2
+ #
3
+ # A PackageManager driver for PEAR (PHP Extension and Application Repository),
4
+ # manages software packages using the <tt>pear</tt> command.
5
+ #
6
+ # === Using specific channels
7
+ #
8
+ # To install a package from the default PEAR channel, just specify it's name,
9
+ # e.g. <tt>HTML_QuickForm</tt>.
10
+ #
11
+ # To install a package from another channel, you must specify the name prefixed
12
+ # with the channel's URL, e.g. <tt>pear.symfony-project.com/symfony</tt>, so
13
+ # that the channel can be automatically added as needed.
14
+ #
15
+ # *IMPORTANT*: DO NOT specify a remote channel's alias, e.g.
16
+ # <tt>symfony/symfony</tt>, because this provides no way to discover the
17
+ # channel.
18
+ class ::AutomateIt::PackageManager::PEAR < ::AutomateIt::PackageManager::BaseDriver
19
+ depends_on :programs => %w(pear)
20
+
21
+ def suitability(method, *args) # :nodoc:
22
+ # Never select as default driver
23
+ return 0
24
+ end
25
+
26
+ # Retrieve a hash containing all installed packages, indexed by package
27
+ # name. Each value is a hash containing values for :version and :state.
28
+ def get_installed_packages()
29
+ cmd = "pear list --allchannels 2>&1"
30
+ data = `#{cmd}`
31
+ installed_packages = {}
32
+ data.scan(/^([^(\s]+)\s+([^\s]+)\s+([^\s]+)$/) do |package, version, state|
33
+ next if version.upcase == 'VERSION'
34
+ installed_packages[package] = {:version => version, :state => state}
35
+ end
36
+ return installed_packages
37
+ end
38
+ protected :get_installed_packages
39
+
40
+ # See AutomateIt::PackageManager#installed?
41
+ def installed?(*packages)
42
+ return _installed_helper?(*packages) do |list, opts|
43
+ all_installed = get_installed_packages().keys.collect {|pkg| pkg.downcase}
44
+
45
+ result = []
46
+ list.each do |pkg|
47
+ pkg_without_channel = pkg.gsub(%r{^[^/]+/}, '').downcase
48
+ result.push pkg if all_installed.include?(pkg_without_channel)
49
+ end
50
+
51
+ result
52
+ end
53
+ end
54
+
55
+ # See AutomateIt::PackageManager#not_installed?
56
+ def not_installed?(*packages)
57
+ return _not_installed_helper?(*packages)
58
+ end
59
+
60
+ # *IMPORTANT*: See documentation at the top of this file for how to correctly
61
+ # install packages from a specific channel.
62
+ #
63
+ # See AutomateIt::PackageManager#install
64
+ def install(*packages)
65
+ return _install_helper(*packages) do |list, opts|
66
+ # pear options:
67
+ # -a install all required dependencies
68
+
69
+ cmd = "(pear config-set auto_discover 1; "
70
+ cmd << "pear install -a "+list.join(" ")+" < /dev/null)"
71
+ cmd << " > /dev/null" if opts[:quiet]
72
+ cmd << " 2>&1"
73
+
74
+ interpreter.sh(cmd)
75
+ end
76
+ end
77
+
78
+ # See AutomateIt::PackageManager#uninstall
79
+ def uninstall(*packages)
80
+ return _uninstall_helper(*packages) do |list, opts|
81
+
82
+ cmd = "pear uninstall "+list.join(" ")+" < /dev/null"
83
+ cmd << " > /dev/null" if opts[:quiet]
84
+ cmd << " 2>&1"
85
+
86
+ interpreter.sh(cmd)
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,74 @@
1
+ # == PackageManager::PECL
2
+ #
3
+ # A PackageManager driver for PECL (PHP Extension Community Library), manages
4
+ # software packages using the <tt>pecl</tt> command.
5
+ class ::AutomateIt::PackageManager::PECL < ::AutomateIt::PackageManager::BaseDriver
6
+ depends_on :programs => %w(pecl)
7
+
8
+ def suitability(method, *args) # :nodoc:
9
+ # Never select as default driver
10
+ return 0
11
+ end
12
+
13
+ # Retrieve a hash containing all installed packages, indexed by package
14
+ # name. Each value is a hash containing values for :channel, :version,
15
+ # and :state.
16
+ def get_installed_packages()
17
+ cmd = "pecl list -a 2>&1"
18
+ data = `#{cmd}`
19
+ installed_packages = {}
20
+ data.scan(/^([^(\s]+)\s+([^\s]+)\s+([^\s]+)$/) do |package, version, state|
21
+ next if version.upcase == 'VERSION'
22
+ installed_packages[package] = {:version => version, :state => state}
23
+ end
24
+ return installed_packages
25
+ end
26
+ protected :get_installed_packages
27
+
28
+ # See AutomateIt::PackageManager#installed?
29
+ def installed?(*packages)
30
+ return _installed_helper?(*packages) do |list, opts|
31
+ all_installed = get_installed_packages().keys.collect {|pkg| pkg.downcase}
32
+
33
+ result = []
34
+ list.each do |pkg|
35
+ pkg_without_channel = pkg.gsub(%r{^[^/]+/}, '').downcase
36
+ result.push pkg if all_installed.include?(pkg_without_channel)
37
+ end
38
+
39
+ result
40
+ end
41
+ end
42
+
43
+
44
+ # See AutomateIt::PackageManager#not_installed?
45
+ def not_installed?(*packages)
46
+ return _not_installed_helper?(*packages)
47
+ end
48
+
49
+ # See AutomateIt::PackageManager#install
50
+ def install(*packages)
51
+ return _install_helper(*packages) do |list, opts|
52
+ # pecl options:
53
+ # -a install all required dependencies
54
+
55
+ cmd = "pecl install -a "+list.join(" ")+" < /dev/null"
56
+ cmd << " > /dev/null" if opts[:quiet]
57
+ cmd << " 2>&1"
58
+
59
+ interpreter.sh(cmd)
60
+ end
61
+ end
62
+
63
+ # See AutomateIt::PackageManager#uninstall
64
+ def uninstall(*packages)
65
+ return _uninstall_helper(*packages) do |list, opts|
66
+
67
+ cmd = "pecl uninstall "+list.join(" ")+" < /dev/null"
68
+ cmd << " > /dev/null" if opts[:quiet]
69
+ cmd << " 2>&1"
70
+
71
+ interpreter.sh(cmd)
72
+ end
73
+ end
74
+ end
@@ -1,7 +1,7 @@
1
1
  # See AutomateIt::Interpreter for usage information.
2
2
  module AutomateIt # :nodoc:
3
3
  # AutomateIt version
4
- VERSION=Gem::Version.new("0.71031.1")
4
+ VERSION=Gem::Version.new("0.71031.2")
5
5
 
6
6
  # Instantiates a new Interpreter. See documentation for
7
7
  # Interpreter#setup.
@@ -77,6 +77,8 @@ else
77
77
  :portage => "arc", # Obscure package for extracting ARC files from the 80's
78
78
  :gem => "s33r", # Alpha-grade package its author deprecated in favor of another
79
79
  :egg => "_sre.py", # Slower reimplementation of ancient Python Regexps
80
+ :pear => "File_DICOM", # Obscure package for DICOM X-rays, abandoned in 2003
81
+ :pecl => "ecasound", # Obscure package for Ecasound libs, abandoned in 2003
80
82
  ### :cpan => "Acme::please", # Insane gimmick port of intercal's please statements
81
83
  }
82
84
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: automateit
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.71031.1
7
- date: 2007-10-31 00:00:00 -07:00
6
+ version: 0.71031.2
7
+ date: 2007-11-01 00:00:00 -07:00
8
8
  summary: AutomateIt is an open source tool for automating the setup and maintenance of servers, applications and their dependencies.
9
9
  require_paths:
10
10
  - lib
@@ -107,7 +107,9 @@ files:
107
107
  - lib/automateit/plugin/base.rb
108
108
  - lib/automateit/plugin/driver.rb
109
109
  - lib/automateit/plugin/manager.rb
110
+ - lib/automateit/package_manager/pear.rb
110
111
  - lib/automateit/package_manager/apt.rb
112
+ - lib/automateit/package_manager/pecl.rb
111
113
  - lib/automateit/package_manager/gem.rb
112
114
  - lib/automateit/package_manager/egg.rb
113
115
  - lib/automateit/package_manager/yum.rb
metadata.gz.sig CHANGED
Binary file