|
|
|
@ -17,6 +17,8 @@
|
|
|
|
|
import sys
|
|
|
|
|
from os import path
|
|
|
|
|
from calculate.install import distr
|
|
|
|
|
from calculate.lib.utils.git import Git
|
|
|
|
|
from calculate.lib.utils.files import pathJoin
|
|
|
|
|
from calculate.lib.datavars import (ReadonlyVariable, FieldValue)
|
|
|
|
|
from calculate.lib.variables import linux as lib_linux
|
|
|
|
|
from calculate.lib.variables import system as lib_system
|
|
|
|
@ -31,19 +33,32 @@ _ = lambda x: x
|
|
|
|
|
setLocalTranslate('cl_builder3', sys.modules[__name__])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClBuilderGit(ReadonlyVariable):
|
|
|
|
|
type = "object"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
chroot_path = self.Get('builder.cl_builder_path')
|
|
|
|
|
sshkey = pathJoin(chroot_path,
|
|
|
|
|
self.Get('update.cl_update_sshkey_path'))
|
|
|
|
|
if path.exists(sshkey):
|
|
|
|
|
return Git(sshkey)
|
|
|
|
|
else:
|
|
|
|
|
return Git()
|
|
|
|
|
|
|
|
|
|
class VariableClBuilderProfileStorage(ReadonlyVariable):
|
|
|
|
|
type = "object"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
git = self.Get('cl_builder_git')
|
|
|
|
|
builder_path = self.Get('cl_builder_path')
|
|
|
|
|
if builder_path:
|
|
|
|
|
builder_ls = path.join(builder_path, "var/lib/layman")
|
|
|
|
|
return update_profile.RepositoryStorageSet(
|
|
|
|
|
update_profile.LocalStorage(builder_ls),
|
|
|
|
|
update_profile.CacheStorage('/var/calculate/tmp/update'))
|
|
|
|
|
update_profile.LocalStorage(git, builder_ls),
|
|
|
|
|
update_profile.CacheStorage(git, '/var/calculate/tmp/update'))
|
|
|
|
|
else:
|
|
|
|
|
return update_profile.RepositoryStorageSet(
|
|
|
|
|
update_profile.CacheStorage('/var/calculate/tmp/update'))
|
|
|
|
|
update_profile.CacheStorage(git, '/var/calculate/tmp/update'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|