mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
commit
765430bfad
3 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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])
|
||||
|
||||
|
|
|
@ -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']))
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue