lib/cupper/recipe.rb in cupper-0.1.1 vs lib/cupper/recipe.rb in cupper-0.1.2
- old
+ new
@@ -50,21 +50,22 @@
when 'rwxr-xr-x' then '755'
when 'rwx------' then '700'
when 'rw-rw-rw-' then '666'
when 'rw-r--r--' then '644'
when 'rw-------' then '600'
+ when 'r--r-----' then '440'
else 'Unknown'
end
result
end
def expand_sources_list(files)
att = Array.new
files.each do |attr|
# TODO: Doesn't works for arch, this should be a plugin responsability
- if attr[0].include?("/etc/apt/sources.list") and (convert_mode(attr[1]['mode']) != 'Unknown') and text_type?(attr)
+ if attr[0].include?("/etc/apt/sources.list") and text_type?(attr)
path = attr[0]
group = attr[1]['group']
mode = attr[1]['mode']
owner = attr[1]['owner']
att.push(new_file(group, mode, owner, path))
@@ -140,18 +141,20 @@
def expand_files(files)
att = Array.new
files.each do |attr|
if text_type?(attr) and (!(attr[1]['related'].nil?) or attr[0].include? "/etc/apt/sources.list")
path = attr[0]
+ source = attr[0]
group = attr[1]['group']
mode = attr[1]['mode']
owner = attr[1]['owner']
- att.push(new_file(group, mode, owner, path))
+ att.push(new_file(group, mode, owner, path,source))
# Related file
source = attr[0].split('/').last
content = attr[1]['content']
- CookbookFile.new(@files_path, source, content, 'cookbook_file').create
+ full_path = attr[0]
+ CookbookFile.new(@files_path, source, content, 'cookbook_file', full_path).create
end
end
att
end