Browse Source

Добавлена короткая опция --other-update, исправлена синхронизация

tags/3.2.0_alpha12
Mike Khiretskiy 7 years ago
parent
commit
bc7067fb12
2 changed files with 18 additions and 3 deletions
  1. +10
    -0
      update/package_tools.py
  2. +8
    -3
      update/variables/update.py

+ 10
- 0
update/package_tools.py View File

@@ -126,6 +126,16 @@ class Layman:
self._add_to_makeconf(rpath)
return True

def get_installed(self):
"""
Получить список установленных репозиториев
"""
if path.exists(self.installed) and readFile(self.installed).strip():
tree = ET.parse(self.installed)
return [x.text for x in tree.findall("repo/name")]
return []


class Git:
"""
Объект для управление git репозиторием


+ 8
- 3
update/variables/update.py View File

@@ -21,10 +21,12 @@ from os import path
from calculate.lib.datavars import (Variable, VariableError,
ReadonlyVariable, ReadonlyTableVariable, TableVariable, FieldValue)
from calculate.lib.utils.portage import searchProfile
from calculate.lib.utils.files import readLinesFile, readFile
from calculate.lib.utils.files import readLinesFile, readFile, makeDirectory, \
listDirectory

from calculate.lib.cl_lang import setLocalTranslate
from calculate.update.emerge_parser import EmergeCache
from calculate.update.package_tools import Git, GitError, Layman

setLocalTranslate('cl_update3',sys.modules[__name__])

@@ -327,7 +329,7 @@ class VariableClUpdateOtherSet(Variable):
"""
type = "bool"
value = "off"
opt = ["--update-other"]
opt = ["-o", "--update-other"]

def init(self):
self.help = _("update other overlays")
@@ -342,10 +344,13 @@ class VariableClUpdateOtherRepData(ReadonlyTableVariable):

def generator(self):
repNames = self.Get('cl_update_rep_name')
layman = Layman(self.Get('cl_update_layman_installed'),
self.Get('cl_update_layman_make'))
layman_overlays = layman.get_installed()
for rpath in self.Get('cl_portdir_overlay'):
repo_file = path.join(rpath,"profiles/repo_name")
rname = readFile(repo_file).strip() or path.basename(rpath)
if not rname in repNames:
if rname in layman_overlays and not rname in repNames:
yield (rname, rpath)

def get(self):


Loading…
Cancel
Save