Merge pull request #331 from nbraud/misc

Misc. fixes & improvements
This commit is contained in:
Anders Ingemann 2016-08-09 22:25:27 +02:00 committed by GitHub
commit 765430bfad
3 changed files with 8 additions and 4 deletions

View file

@ -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)

View file

@ -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])

View file

@ -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)