mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Fix indentation, remove unused import
use absolute path to apt-get
This commit is contained in:
parent
e4e6035eb2
commit
8fe457b2dc
1 changed files with 19 additions and 21 deletions
|
@ -8,31 +8,29 @@ import os
|
||||||
|
|
||||||
|
|
||||||
class AptSourcesBackports(Task):
|
class AptSourcesBackports(Task):
|
||||||
description = 'Adding backports to sources.list'
|
description = 'Adding backports to sources.list'
|
||||||
phase = phases.system_modification
|
phase = phases.system_modification
|
||||||
after = [AptSources]
|
after = [AptSources]
|
||||||
before = [AptUpgrade]
|
before = [AptUpgrade]
|
||||||
def run(self, info):
|
|
||||||
sources_path = os.path.join(info.root, 'etc/apt/sources.list')
|
def run(self, info):
|
||||||
with open(sources_path, 'a') as apt_sources:
|
sources_path = os.path.join(info.root, 'etc/apt/sources.list')
|
||||||
apt_sources.write(('deb {apt_mirror} {release}-backports main\n'
|
with open(sources_path, 'a') as apt_sources:
|
||||||
'deb-src {apt_mirror} {release}-backports main\n'
|
apt_sources.write(('deb {apt_mirror} {release}-backports main\n'
|
||||||
.format(apt_mirror='http://http.debian.net/debian',
|
'deb-src {apt_mirror} {release}-backports main\n'
|
||||||
release=info.manifest.system['release'])))
|
.format(apt_mirror='http://http.debian.net/debian',
|
||||||
|
release=info.manifest.system['release'])))
|
||||||
|
|
||||||
|
|
||||||
class AddBackportsPackages(Task):
|
class AddBackportsPackages(Task):
|
||||||
description = 'Adding backport packages to the image'
|
description = 'Adding backport packages to the image'
|
||||||
phase = phases.system_modification
|
phase = phases.system_modification
|
||||||
after = [AptUpgrade]
|
after = [AptUpgrade]
|
||||||
|
|
||||||
|
def run(self, info):
|
||||||
|
if 'packages' not in info.manifest.plugins['backports']:
|
||||||
|
return
|
||||||
|
|
||||||
def run(self, info):
|
from common.tools import log_check_call
|
||||||
if 'packages' not in info.manifest.plugins['backports']:
|
for pkg in info.manifest.plugins['backports']['packages']:
|
||||||
return
|
log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'install', '-y', '-t', info.manifest.system['release'] + '-backports', pkg])
|
||||||
|
|
||||||
from shutil import copy
|
|
||||||
from common.tools import log_check_call
|
|
||||||
|
|
||||||
for pkg in info.manifest.plugins['backports']['packages']:
|
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, 'apt-get', 'install', '-y', '-t', info.manifest.system['release'] + '-backports', pkg])
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue