|
|
|
@ -2220,3 +2220,23 @@ class Builder(Update):
|
|
|
|
|
except OSError as e:
|
|
|
|
|
# raise BuilderError(_("Failed to find /etc/machine-id"))
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def set_current_saved_tag(self):
|
|
|
|
|
#TODO add to var?
|
|
|
|
|
repname = "calculate"
|
|
|
|
|
dv = self.clVars.Get('cl_builder_linux_datavars')
|
|
|
|
|
git = self.getGit()
|
|
|
|
|
rpath, revision = (
|
|
|
|
|
dv.Select(["cl_update_rep_path",
|
|
|
|
|
"cl_update_rep_rev"],
|
|
|
|
|
where="cl_update_rep_name",
|
|
|
|
|
eq=repname, limit=1))
|
|
|
|
|
try:
|
|
|
|
|
branch_name = self.clVars.Select(["cl_builder_branch_name"],
|
|
|
|
|
where="cl_builder_branch_rep", eq=repname, limit=1)[0]
|
|
|
|
|
tag = git.getCurrentTag(rpath)
|
|
|
|
|
if branch_name == Git.Reference.Tag and tag.isdigit():
|
|
|
|
|
self.clVars.Write("cl_update_saved_tag", str(tag), location="system")
|
|
|
|
|
return True
|
|
|
|
|
except ValueError as e:
|
|
|
|
|
return False
|