From a03581b798a5562ed24784065dc7ad067e5cd3ce Mon Sep 17 00:00:00 2001 From: root Date: Thu, 10 Nov 2022 14:28:54 +0300 Subject: [PATCH] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE:=20=20=20=20=20=20pym/update/update.py=20=09=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=BE:=20=20=20=20=20=20pym/upda?= =?UTF-8?q?te/variables/update.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/update.py | 5 ++++- pym/update/variables/update.py | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index 6c32ff0..56de88a 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -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 diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 2243016..0890b69 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -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):