mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Add AddDefaultSources as AddBackports predecessor
This commit is contained in:
parent
a1e17841d3
commit
cc95f146b1
1 changed files with 19 additions and 19 deletions
|
@ -1,27 +1,11 @@
|
||||||
from bootstrapvz.base import Task
|
from bootstrapvz.base import Task
|
||||||
from .. import phases
|
from bootstrapvz.common import phases
|
||||||
from ..tools import log_check_call
|
from bootstrapvz.common.tools import log_check_call
|
||||||
import locale
|
import locale
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class AddBackports(Task):
|
|
||||||
description = 'Adding backports to the apt sources'
|
|
||||||
phase = phases.preparation
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def run(cls, info):
|
|
||||||
if info.source_lists.target_exists('{system.release}-backports'):
|
|
||||||
msg = ('{system.release}-backports target already exists').format(**info.manifest_vars)
|
|
||||||
logging.getLogger(__name__).info(msg)
|
|
||||||
elif info.release_codename == 'sid':
|
|
||||||
logging.getLogger(__name__).info('There are no backports for sid/unstable')
|
|
||||||
else:
|
|
||||||
info.source_lists.add('backports', 'deb {apt_mirror} {system.release}-backports main')
|
|
||||||
info.source_lists.add('backports', 'deb-src {apt_mirror} {system.release}-backports main')
|
|
||||||
|
|
||||||
|
|
||||||
class AddManifestSources(Task):
|
class AddManifestSources(Task):
|
||||||
description = 'Adding sources from the manifest'
|
description = 'Adding sources from the manifest'
|
||||||
phase = phases.preparation
|
phase = phases.preparation
|
||||||
|
@ -50,6 +34,23 @@ class AddDefaultSources(Task):
|
||||||
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + components)
|
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + components)
|
||||||
|
|
||||||
|
|
||||||
|
class AddBackports(Task):
|
||||||
|
description = 'Adding backports to the apt sources'
|
||||||
|
phase = phases.preparation
|
||||||
|
predecessors = [AddDefaultSources]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
if info.source_lists.target_exists('{system.release}-backports'):
|
||||||
|
msg = ('{system.release}-backports target already exists').format(**info.manifest_vars)
|
||||||
|
logging.getLogger(__name__).info(msg)
|
||||||
|
elif info.release_codename == 'sid':
|
||||||
|
logging.getLogger(__name__).info('There are no backports for sid/unstable')
|
||||||
|
else:
|
||||||
|
info.source_lists.add('backports', 'deb {apt_mirror} {system.release}-backports main')
|
||||||
|
info.source_lists.add('backports', 'deb-src {apt_mirror} {system.release}-backports main')
|
||||||
|
|
||||||
|
|
||||||
class AddManifestPreferences(Task):
|
class AddManifestPreferences(Task):
|
||||||
description = 'Adding preferences from the manifest'
|
description = 'Adding preferences from the manifest'
|
||||||
phase = phases.preparation
|
phase = phases.preparation
|
||||||
|
@ -155,7 +156,6 @@ class AptUpgrade(Task):
|
||||||
'--assume-yes'])
|
'--assume-yes'])
|
||||||
except CalledProcessError as e:
|
except CalledProcessError as e:
|
||||||
if e.returncode == 100:
|
if e.returncode == 100:
|
||||||
import logging
|
|
||||||
msg = ('apt exited with status code 100. '
|
msg = ('apt exited with status code 100. '
|
||||||
'This can sometimes occur when package retrieval times out or a package extraction failed. '
|
'This can sometimes occur when package retrieval times out or a package extraction failed. '
|
||||||
'apt might succeed if you try bootstrapping again.')
|
'apt might succeed if you try bootstrapping again.')
|
||||||
|
|
Loading…
Add table
Reference in a new issue