diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index 001d588..1bb46ad 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -24,13 +24,13 @@ class AddDefaultSources(Task): @classmethod def run(cls, info): - from bootstrapvz.common.releases import sid + from bootstrapvz.common.releases import sid, wheezy include_src = info.manifest.packages.get('include-source-type', False) components = ' '.join(info.manifest.packages.get('components', ['main'])) info.source_lists.add('main', 'deb {apt_mirror} {system.release} ' + components) if include_src: info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} ' + components) - if info.manifest.release != sid: + if info.manifest.release != sid and info.manifest.release >= wheezy: info.source_lists.add('main', 'deb http://security.debian.org/ {system.release}/updates ' + components) if include_src: info.source_lists.add('main', 'deb-src http://security.debian.org/ {system.release}/updates ' + components) diff --git a/bootstrapvz/plugins/file_copy/__init__.py b/bootstrapvz/plugins/file_copy/__init__.py index eec9cb9..6bdbc60 100644 --- a/bootstrapvz/plugins/file_copy/__init__.py +++ b/bootstrapvz/plugins/file_copy/__init__.py @@ -9,7 +9,7 @@ def validate_manifest(data, validator, error): for i, file_entry in enumerate(data['plugins']['file_copy']['files']): srcfile = file_entry['src'] - if not os.path.isfile(srcfile): + if not os.path.exists(srcfile): msg = 'The source file %s does not exist.' % srcfile error(msg, ['plugins', 'file_copy', 'files', i]) diff --git a/bootstrapvz/plugins/file_copy/tasks.py b/bootstrapvz/plugins/file_copy/tasks.py index cc1a783..179cffd 100644 --- a/bootstrapvz/plugins/file_copy/tasks.py +++ b/bootstrapvz/plugins/file_copy/tasks.py @@ -47,5 +47,9 @@ class FileCopyCommand(Task): # note that we don't use os.path.join because it can't # handle absolute paths, which 'dst' most likely is. final_destination = os.path.normpath("%s/%s" % (info.root, file_entry['dst'])) - shutil.copy(file_entry['src'], final_destination) + if os.path.isfile(file_entry['src']): + shutil.copy(file_entry['src'], final_destination) + else: + shutil.copytree(file_entry['src'], final_destination) + modify_path(info, file_entry['dst'], file_entry)