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

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

@ -447,7 +447,10 @@ class Update(MethodsInterface):
if not git.checkUrl(url): if not git.checkUrl(url):
raise UpdateError(_("Git %s is unavailable") % url) raise UpdateError(_("Git %s is unavailable") % url)
# --------------DEPRECATED--------------# # --------------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')) chroot_path = path.normpath(self.clVars.Get('cl_chroot_path'))
if chroot_path == '/': if chroot_path == '/':
rpath_orig = rpath rpath_orig = rpath

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

Loading…
Cancel
Save