|
|
|
@ -549,7 +549,7 @@ class VariableClUpdateProfileLinuxVer(ReadonlyVariable):
|
|
|
|
|
Имя системы в профиле
|
|
|
|
|
"""
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Profile system version")
|
|
|
|
|
self.label = _("System profile version")
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
dv = self.Get('cl_update_profile_datavars')
|
|
|
|
@ -578,7 +578,7 @@ class VariableClUpdateProfileRep(Variable):
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Profile repository")
|
|
|
|
|
self.help = _("set profile repository")
|
|
|
|
|
self.help = _("set the profile repository")
|
|
|
|
|
|
|
|
|
|
re_url = re.compile(
|
|
|
|
|
r"^(?:(%s)://)?(\w[\w\./:-]+?\w)(\.git)?$" % "|".join(
|
|
|
|
@ -590,7 +590,7 @@ class VariableClUpdateProfileRep(Variable):
|
|
|
|
|
def normalize_url(cls, url):
|
|
|
|
|
match = cls.re_url.match(url)
|
|
|
|
|
if not match:
|
|
|
|
|
raise VariableError(_("Failed repository url"))
|
|
|
|
|
raise VariableError(_("Wrong repository URL"))
|
|
|
|
|
url = match.group(2)
|
|
|
|
|
url = "%s://%s" % (match.group(1) or "git", url)
|
|
|
|
|
url = "%s.git" % url
|
|
|
|
@ -607,12 +607,12 @@ class VariableClUpdateProfileRep(Variable):
|
|
|
|
|
where='cl_update_rep_host',
|
|
|
|
|
eq=match.group(1), limit=1)
|
|
|
|
|
if not template:
|
|
|
|
|
raise VariableError(_("Failed to determine repository host"))
|
|
|
|
|
raise VariableError(_("Failed to determine the repository host"))
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
return template % match.group(2)
|
|
|
|
|
except TypeError:
|
|
|
|
|
raise VariableError(_("Failed to determine repository host"))
|
|
|
|
|
raise VariableError(_("Failed to determine the repository host"))
|
|
|
|
|
|
|
|
|
|
def set(self, value):
|
|
|
|
|
if self.re_shortname.match(value):
|
|
|
|
@ -628,7 +628,7 @@ class VariableClUpdateProfileRep(Variable):
|
|
|
|
|
except GitError as e:
|
|
|
|
|
raise VariableError(str(e))
|
|
|
|
|
if not self.Get('cl_profile_shortname'):
|
|
|
|
|
raise VariableError(_("Repository %s has not profiles")%value)
|
|
|
|
|
raise VariableError(_("Repository %s has no profiles")%value)
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
try:
|
|
|
|
@ -666,7 +666,7 @@ class VariableClUpdateProfileBranch(Variable):
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Repository branch")
|
|
|
|
|
self.help = _("set repository branch")
|
|
|
|
|
self.help = _("set the repository branch")
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
pass
|
|
|
|
@ -782,11 +782,11 @@ class VariableClUpdateProfileSystem(Variable):
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("System profile")
|
|
|
|
|
self.help = _("set system profile")
|
|
|
|
|
self.help = _("set the system profile")
|
|
|
|
|
|
|
|
|
|
def check(self, profile):
|
|
|
|
|
if not profile:
|
|
|
|
|
raise VariableError(_("Profile must be specified"))
|
|
|
|
|
raise VariableError(_("You must specify the profile"))
|
|
|
|
|
path_profile = self.Select('cl_profile_path',
|
|
|
|
|
where='cl_profile_shortname',
|
|
|
|
|
eq=profile, limit=1)
|
|
|
|
@ -795,8 +795,8 @@ class VariableClUpdateProfileSystem(Variable):
|
|
|
|
|
try:
|
|
|
|
|
if (not dv.Get('cl_update_rep_name') or
|
|
|
|
|
not dv.Get('cl_update_rep_url')):
|
|
|
|
|
raise VariableError(_("Repository variables is not "
|
|
|
|
|
"configured in profile"))
|
|
|
|
|
raise VariableError(_("Repository variables "
|
|
|
|
|
"were not configured for the profile"))
|
|
|
|
|
if not dv.Get('os_linux_name'):
|
|
|
|
|
raise VariableError()
|
|
|
|
|
except (DataVarsError, VariableError) as e:
|
|
|
|
|