Browse Source

i

tags/3.7.0
idziubenko 2 months ago
parent
commit
659f1d1920
6 changed files with 16 additions and 17 deletions
  1. +2
    -2
      pym/update/profile.py
  2. +9
    -9
      pym/update/update.py
  3. +1
    -2
      pym/update/update_info.py
  4. +2
    -2
      pym/update/variables/__init__.py
  5. +1
    -1
      pym/update/variables/update.py
  6. +1
    -1
      pym/update/wsdl_update.py

+ 2
- 2
pym/update/profile.py View File

@@ -21,7 +21,7 @@ import shutil
from calculate.lib.utils.files import (listDirectory, readFile, readLinesFile,
makeDirectory, removeDir)
from calculate.lib.utils.git import Git
from update import UpdateError
from .update import UpdateError

from calculate.lib.cl_lang import setLocalTranslate, _
setLocalTranslate('cl_update3', sys.modules[__name__])
@@ -209,7 +209,7 @@ class ProfileRepository(object):
if git.is_private_url(url):
try:
makeDirectory(rpath)
os.chmod(rpath, 0700)
os.chmod(rpath, 0o700)
except OSError:
pass
git.cloneRepository(url, rpath, branch)


+ 9
- 9
pym/update/update.py View File

@@ -29,9 +29,9 @@ from calculate.lib.datavars import DataVarsError, VariableError, Variable
from calculate.lib.utils.tools import AddonError
from calculate.lib.utils.colortext.palette import TextState
from calculate.lib.utils.colortext import get_color_print
from calculate.update.emerge_parser import RevdepPercentBlock
from calculate.update.datavars import DataVarsUpdate
from calculate.update.update_info import UpdateInfo
from .emerge_parser import RevdepPercentBlock
from .datavars import DataVarsUpdate
from .update_info import UpdateInfo
from calculate.lib.utils.binhosts import (Binhosts, BinhostSignError,
BinhostError, PackagesIndex, DAYS)
from calculate.lib.utils.gpg import GPG, GPGError
@@ -65,9 +65,9 @@ from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
readFile, listDirectory, pathJoin,
find, FindFileType,quite_unlink,
writeFile, makeDirectory)
import emerge_parser
from . import emerge_parser
import logging
from emerge_parser import (EmergeParser, EmergeCommand, EmergeError,
from .emerge_parser import (EmergeParser, EmergeCommand, EmergeError,
EmergeCache, Chroot)

from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate,
@@ -177,19 +177,19 @@ class Update(MethodsInterface):
try:
if not path.exists(rpath):
makeDirectory(rpath)
os.chmod(rpath, 0700)
os.chmod(rpath, 0o700)
yield
finally:
try:
for dn in (Git._gitDir(rpath), path.join(rpath, "profiles/templates")):
if path.exists(dn):
os.chmod(dn, 0700)
os.chmod(dn, 0o700)
for fn in find(path.join(rpath, "profiles"), True, FindFileType.RegularFile,
True, None, downfilter=lambda x: not x.endswith("/templates")):
if fn.endswith("calculate.env") or fn.endswith("ini.env"):
os.chmod(fn, 0600)
os.chmod(fn, 0o600)
if path.exists(rpath):
os.chmod(rpath, 0755)
os.chmod(rpath, 0o755)
except OSError:
pass
else:


+ 1
- 2
pym/update/update_info.py View File

@@ -16,7 +16,6 @@

import os
from os import path
from itertools import ifilter
from calculate.core.datavars import DataVarsCore
from calculate.core.server.gen_pid import search_worked_process
from calculate.lib.cl_template import SystemIni
@@ -71,7 +70,7 @@ class UpdateInfo(object):
"""
Проверить есть ли уже запущенная копия console-gui
"""
return any(ifilter(lambda x: "cl-console-gui" in x, getRunCommands()))
return any(filter(lambda x: "cl-console-gui" in x, getRunCommands()))

def update_already_run(self):
"""


+ 2
- 2
pym/update/variables/__init__.py View File

@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import action
import update
from . import action
from . import update

section = "update"

+ 1
- 1
pym/update/variables/update.py View File

@@ -42,7 +42,7 @@ from calculate.lib.variables import env
from calculate.lib.variables import system as lib_system
from calculate.update.update_info import UpdateInfo
from itertools import chain
from urlparse import urlparse
from urllib.parse import urlparse
import io
import time



+ 1
- 1
pym/update/wsdl_update.py View File

@@ -20,7 +20,7 @@ from calculate.lib.datavars import VariableError,DataVarsError

from calculate.core.server.func import WsdlBase
from calculate.install.install import InstallError
from calculate.update.update import Update, UpdateError
from .update import Update, UpdateError
from calculate.lib.utils.git import GitError
from utils.cl_update import ClUpdateAction
from utils.cl_update_profile import ClUpdateProfileAction


Loading…
Cancel
Save