deprec-core 3.1.12 → 3.1.13

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,6 +1,10 @@
1
1
  deprec-core changelog
2
2
  =====================
3
3
 
4
+ = 3.1.13 (Aug 2, 2011)
5
+
6
+ * Only run 'apt-get update' once per capistrano run
7
+
4
8
  = 3.1.12 (Jul 30, 2011)
5
9
 
6
10
  * added pretty colors to terminal output
@@ -1,5 +1,5 @@
1
1
  module Deprec
2
2
  module Core
3
- VERSION = "3.1.12"
3
+ VERSION = "3.1.13"
4
4
  end
5
5
  end
@@ -24,12 +24,13 @@ module Apt
24
24
 
25
25
  # Default apt-get command - reduces any interactivity to the minimum.
26
26
  APT_GET="DEBCONF_TERSE='yes' DEBIAN_PRIORITY='critical' DEBIAN_FRONTEND=noninteractive apt-get"
27
+ UPDATE = { :has_been_run => false }
27
28
 
28
29
  # Run the apt install program across the package list in 'packages'.
29
30
  # Select those packages referenced by <tt>:base</tt> and the +version+
30
31
  # of the distribution you want to use.
31
32
  def install(packages, version, options={})
32
- update
33
+ update :once_only => true
33
34
  special_options="--allow-unauthenticated" if version != :stable
34
35
  send(run_method, %{
35
36
  sh -c "#{APT_GET} -qyu --force-yes #{special_options.to_s} install #{package_list(packages, version)}"
@@ -48,20 +49,25 @@ module Apt
48
49
 
49
50
  # Run an apt distribution upgrade
50
51
  def dist_upgrade(options={})
51
- update
52
+ update :once_only => true
52
53
  send(run_method, %{sh -c "#{APT_GET} -qy dist-upgrade"}, options)
53
54
  end
54
55
 
55
56
  # Run an apt upgrade. Use dist_upgrade instead if you want to upgrade
56
57
  # the critical base packages.
57
58
  def upgrade(options={})
58
- update
59
+ update :once_only => true
59
60
  send(run_method, %{sh -c "#{APT_GET} -qy upgrade"}, options)
60
61
  end
61
62
 
62
63
  # Run an apt update.
63
64
  def update(options={})
64
- send(run_method, %{sh -c "#{APT_GET} -qy update"}, options)
65
+ if options[:once_only] && UPDATE[:has_been_run]
66
+ return false
67
+ else
68
+ send(run_method, %{sh -c "#{APT_GET} -qy update"}, options)
69
+ UPDATE[:has_been_run] = true
70
+ end
65
71
  end
66
72
 
67
73
  # RPM package install via alien
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: deprec-core
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.1.12
5
+ version: 3.1.13
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mike Bailey
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-29 00:00:00 Z
13
+ date: 2011-08-02 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake