изменено: pym/update/update.py

изменено:      pym/update/variables/update.py
master 3.7.2.37
root 1 year ago
parent c59f7b06fb
commit a03581b798

@ -447,7 +447,10 @@ class Update(MethodsInterface):
if not git.checkUrl(url):
raise UpdateError(_("Git %s is unavailable") % url)
# --------------DEPRECATED--------------#
# check for readonly fs
if not os.access(rpath, os.W_OK):
self.printWARNING(_("Read only FS was found in %s, skipping this step") % rpath)
return True
chroot_path = path.normpath(self.clVars.Get('cl_chroot_path'))
if chroot_path == '/':
rpath_orig = rpath

@ -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):

Loading…
Cancel
Save