From f1fcc025bd61d6d59d9ee8e044b7d58e33ed9697 Mon Sep 17 00:00:00 2001 From: Matt Whiteley Date: Thu, 12 Dec 2013 15:42:22 -0800 Subject: [PATCH] Only update the cache for the created repository --- providers/repository.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/providers/repository.rb b/providers/repository.rb index 27b7dfcd..a4810507 100644 --- a/providers/repository.rb +++ b/providers/repository.rb @@ -107,9 +107,16 @@ def build_repo(uri, distribution, components, trusted, arch, add_deb_src) action :nothing end + execute 'apt-cache gencaches' do + ignore_failure true + action :nothing + end + execute 'apt-get update' do + command "apt-get update -o Dir::Etc::sourcelist='sources.list.d/#{new_resource.name}.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'" ignore_failure true action :nothing + notifies :run, 'execute[apt-cache gencaches]', :immediately end # build repo file