opscode-cookbooks/apt — pull request #13 by gilles (2012-08-27 05:04:40+00:00)
Title: Cook 1500

New request for COOK-1500, seems I messed up the first one.

Avoid triggering apt-get update

This allows:

```ruby
#run apt-get update after the 2 repos are added. Not each time.
r = apt_repository 'A' do
uri 'http://A'
deb_src true
apt_update false
action :nothing
end
r.run_action(:add)
updated = r.updated?

r = apt_repository 'B' do
uri 'http://B'
apt_update false
action :nothing
end
r.run_action(:add)
updated ||= r.updated?

if updated
resources(:execute => 'apt-get update').run_action(:run)
end
```