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