|
|
|
@ -33,7 +33,7 @@ from .files import (getProgPath, find, process, listDirectory, readFile,
|
|
|
|
|
readLinesFile, pathJoin, makeDirectory,
|
|
|
|
|
FilesError, rsync_files, RsyncOptions,
|
|
|
|
|
removeDir, removeFileWithEmptyDirectory, FindFileType)
|
|
|
|
|
from .tools import SavableIterator, ignore
|
|
|
|
|
from .tools import SaveableIterator, ignore
|
|
|
|
|
from .system import SystemPath
|
|
|
|
|
from collections.abc import Mapping
|
|
|
|
|
from collections import defaultdict
|
|
|
|
@ -307,7 +307,7 @@ class ReposConf():
|
|
|
|
|
'location': rpath}.items():
|
|
|
|
|
config.set(rname, k, v)
|
|
|
|
|
self.add_default(config)
|
|
|
|
|
with open(conffile, 'wb') as f:
|
|
|
|
|
with open(conffile, 'w') as f:
|
|
|
|
|
config.write(f)
|
|
|
|
|
|
|
|
|
|
def remove(self, rname):
|
|
|
|
@ -315,11 +315,11 @@ class ReposConf():
|
|
|
|
|
return
|
|
|
|
|
conffile = pathJoin(self.prefix, self.conffile)
|
|
|
|
|
config = ConfigParser(strict=False)
|
|
|
|
|
config.read(conffile, encoding="utf-8")
|
|
|
|
|
config.read(conffile)
|
|
|
|
|
if config.has_section(rname):
|
|
|
|
|
config.remove_section(rname)
|
|
|
|
|
self.add_default(config)
|
|
|
|
|
with open(conffile, 'wb') as f:
|
|
|
|
|
with open(conffile, 'w') as f:
|
|
|
|
|
config.write(f)
|
|
|
|
|
|
|
|
|
|
def get_calculate_repositories(self):
|
|
|
|
@ -328,7 +328,7 @@ class ReposConf():
|
|
|
|
|
"""
|
|
|
|
|
conffile = pathJoin(self.prefix, self.conffile)
|
|
|
|
|
config = ConfigParser(strict=False)
|
|
|
|
|
config.read(conffile, encoding="utf-8")
|
|
|
|
|
config.read(conffile)
|
|
|
|
|
for rep in config.sections():
|
|
|
|
|
if rep != "gentoo":
|
|
|
|
|
location = config[rep]["location"]
|
|
|
|
@ -347,7 +347,7 @@ class ReposConf():
|
|
|
|
|
if conffile == conffn:
|
|
|
|
|
continue
|
|
|
|
|
config = ConfigParser(strict=False)
|
|
|
|
|
config.read(conffile, encoding="utf-8")
|
|
|
|
|
config.read(conffile)
|
|
|
|
|
for rep in config.sections():
|
|
|
|
|
if rep not in skip_reps:
|
|
|
|
|
location = config[rep].get("location")
|
|
|
|
@ -690,9 +690,9 @@ class PackageInformation:
|
|
|
|
|
timeout=60).read()
|
|
|
|
|
except pexpect.TIMEOUT:
|
|
|
|
|
output = ""
|
|
|
|
|
re_cut = re.compile("^.*?(?=<\?xml version)", re.S)
|
|
|
|
|
re_cut = re.compile(b"^.*?(?=<\?xml version)", re.S)
|
|
|
|
|
with ignore(ET.ParseError):
|
|
|
|
|
xml = ET.fromstring(re_cut.sub('', output))
|
|
|
|
|
xml = ET.fromstring(re_cut.sub(b'', output))
|
|
|
|
|
for pkg in self.query_packages:
|
|
|
|
|
cat_pn = pkg['CATEGORY/PN']
|
|
|
|
|
if not cat_pn in self.information_cache:
|
|
|
|
@ -1122,7 +1122,7 @@ class EmergeLog():
|
|
|
|
|
"""
|
|
|
|
|
Получить список измений по логу, от последней записи маркера
|
|
|
|
|
"""
|
|
|
|
|
log_data = SavableIterator(iter(readLinesFile(self.emerge_log)))
|
|
|
|
|
log_data = SaveableIterator(iter(readLinesFile(self.emerge_log)))
|
|
|
|
|
for line in log_data.save():
|
|
|
|
|
if self.emerge_task.has_marker(line):
|
|
|
|
|
log_data.save()
|
|
|
|
|