From ff517b041821986dbf5141ec73ea80b35028e259 Mon Sep 17 00:00:00 2001 From: Thom May Date: Mon, 23 Mar 2015 14:39:45 +0000 Subject: [PATCH] Ensure that the enclosing apt.conf.d dir exists Closes #129 --- recipes/default.rb | 4 ++++ resources/preference.rb | 2 +- resources/repository.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index 49c6b083..bfeabbd0 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -50,6 +50,10 @@ end # Updates 'apt-get update' timestamp after each update success +directory '/etc/apt/apt.conf.d' do + recursive true +end + cookbook_file '/etc/apt/apt.conf.d/15update-stamp' do source '15update-stamp' end diff --git a/resources/preference.rb b/resources/preference.rb index 7f734971..64eb34f0 100644 --- a/resources/preference.rb +++ b/resources/preference.rb @@ -31,7 +31,7 @@ def initialize(*args) :pin, :pin_priority -attribute :package_name, :kind_of => String, :name_attribute => true, :regex => [ /^([a-z]|[A-Z]|[0-9]|_|-|\.)+$/ ] +attribute :package_name, :kind_of => String, :name_attribute => true, :regex => [/^([a-z]|[A-Z]|[0-9]|_|-|\.)+$/] attribute :glob, :kind_of => String attribute :pin, :kind_of => String attribute :pin_priority, :kind_of => String diff --git a/resources/repository.rb b/resources/repository.rb index 1a67e512..b9268eed 100644 --- a/resources/repository.rb +++ b/resources/repository.rb @@ -39,7 +39,7 @@ def initialize(*args) :uri # name of the repo, used for source.list filename -attribute :repo_name, :kind_of => String, :name_attribute => true, :regex => [ /^([a-z]|[A-Z]|[0-9]|_|-|\.)+$/ ] +attribute :repo_name, :kind_of => String, :name_attribute => true, :regex => [/^([a-z]|[A-Z]|[0-9]|_|-|\.)+$/] attribute :uri, :kind_of => String attribute :distribution, :kind_of => String attribute :components, :kind_of => Array, :default => []