diff --git a/resources/preference.rb b/resources/preference.rb index ef771a1f..7f734971 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 +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 71a40aa6..1a67e512 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 +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 => []