app/cyclid/plugins/provisioner/debian.rb in cyclid-0.2.4 vs app/cyclid/plugins/provisioner/debian.rb in cyclid-0.2.5

- old
+ new

@@ -23,10 +23,14 @@ class Debian < Provisioner # Prepare a Debian based build host def prepare(transport, buildhost, env = {}) transport.export_env('DEBIAN_FRONTEND' => 'noninteractive') + # Build hosts may require an update before anything can be installed + success = transport.exec 'apt-get update' + raise 'failed to update repositories' unless success + if env.key? :repos env[:repos].each do |repo| next unless repo.key? :url url = repo[:url] @@ -37,9 +41,10 @@ when 'http', 'https' add_http_repository(transport, url, repo, buildhost) end end + # We must update again to cache the new repositories success = transport.exec 'apt-get update' raise 'failed to update repositories' unless success end if env.key? :packages