|
|
|
@ -992,6 +992,7 @@ class VariableClUpdateProfileUrl(Variable):
|
|
|
|
|
untrusted = True
|
|
|
|
|
check_after = ["cl_update_profile_branch"]
|
|
|
|
|
check_action = "update_profile"
|
|
|
|
|
value = ''
|
|
|
|
|
|
|
|
|
|
opt = ["--url"]
|
|
|
|
|
metavalue = "URL"
|
|
|
|
@ -999,7 +1000,6 @@ class VariableClUpdateProfileUrl(Variable):
|
|
|
|
|
profile = "cl_profile_system"
|
|
|
|
|
branch = "cl_update_profile_branch"
|
|
|
|
|
storage = "cl_update_profile_storage"
|
|
|
|
|
default_url = "https://github.com/calculatelinux/distros.git"
|
|
|
|
|
profiles_shortname = 'cl_update_profile_shortname'
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@ -1052,7 +1052,7 @@ class VariableClUpdateProfileUrl(Variable):
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
if not value:
|
|
|
|
|
raise VariableError("Need to specify profile repository")
|
|
|
|
|
raise VariableError(_("Need to specify profile repository"))
|
|
|
|
|
try:
|
|
|
|
|
branch = self.Get(self.branch)
|
|
|
|
|
self.Get(self.storage).get_profiles(value, branch)
|
|
|
|
@ -1072,7 +1072,7 @@ class VariableClUpdateProfileUrl(Variable):
|
|
|
|
|
path.join(profile,"profiles"))):
|
|
|
|
|
profile = path.dirname(profile)
|
|
|
|
|
if profile == self.current_root:
|
|
|
|
|
return self.default_url
|
|
|
|
|
return self.value
|
|
|
|
|
if ".git" not in listDirectory(profile):
|
|
|
|
|
repo_name = readFile(path.join(
|
|
|
|
|
profile,"profiles/repo_name")).strip()
|
|
|
|
@ -1081,12 +1081,12 @@ class VariableClUpdateProfileUrl(Variable):
|
|
|
|
|
raise CriticalError(
|
|
|
|
|
_("You need to update the repositories before "
|
|
|
|
|
"you change the profile"))
|
|
|
|
|
return Git.get_url(profile, "origin") or self.default_url
|
|
|
|
|
return Git.get_url(profile, "origin")
|
|
|
|
|
except CriticalError as e:
|
|
|
|
|
raise VariableError(str(e))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pass
|
|
|
|
|
return self.default_url
|
|
|
|
|
return self.value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateProfileRepoName(ReadonlyVariable):
|
|
|
|
|