|
|
|
@ -232,7 +232,7 @@ class Builder(Update):
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
data = []
|
|
|
|
|
re_subbuild = re.compile(r"\/[^-]+-[^-]+-(\d+)-[^-]+$", re.I)
|
|
|
|
|
re_subbuild = re.compile("\/[^-]+-[^-]+-(\d+)-[^-]+$", re.I)
|
|
|
|
|
for container_dn in listDirectory(dn, fullPath=True):
|
|
|
|
|
with ContainerDistributive(container_dn) as distro:
|
|
|
|
|
info = distro.get_information()
|
|
|
|
@ -857,7 +857,7 @@ class Builder(Update):
|
|
|
|
|
eclassdata = readFile(nvidia_eclass)
|
|
|
|
|
reBlock = re.compile(
|
|
|
|
|
r"if has \$\{nvidia_gpu\}\s+\\([^;]+);\s*then(.*?)fi", re.S)
|
|
|
|
|
reMask = re.compile(r'>=x11-drivers/nvidia-drivers[^"]+')
|
|
|
|
|
reMask = re.compile('>=x11-drivers/nvidia-drivers[^"]+')
|
|
|
|
|
for block in reBlock.findall(eclassdata):
|
|
|
|
|
nvidia_ids, mask_data = block
|
|
|
|
|
m = reMask.search(mask_data)
|
|
|
|
@ -1290,7 +1290,7 @@ class Builder(Update):
|
|
|
|
|
self._update_binhost_packages()
|
|
|
|
|
if path.exists(pathPackages):
|
|
|
|
|
re_keywords = re.compile(
|
|
|
|
|
r'^(KEYWORDS|SYNC):.*$\n', re.M)
|
|
|
|
|
'^(KEYWORDS|SYNC):.*$\n', re.M)
|
|
|
|
|
data = readFile(pathPackages)
|
|
|
|
|
data_blocks = data.split('\n\n')
|
|
|
|
|
modified_blocks = [
|
|
|
|
@ -1318,37 +1318,33 @@ class Builder(Update):
|
|
|
|
|
os.makedirs(pkgDir)
|
|
|
|
|
if path.exists(dbPkg) and path.exists(pkgDir):
|
|
|
|
|
# get pkg list from distro
|
|
|
|
|
pkgList = \
|
|
|
|
|
reduce(lambda x, y: x + y,
|
|
|
|
|
map(lambda x: map(
|
|
|
|
|
lambda z: path.join(x, "%s.tbz2" % z),
|
|
|
|
|
os.listdir(path.join(dbPkg, x))),
|
|
|
|
|
os.listdir(dbPkg)), [])
|
|
|
|
|
pkgList = reduce(lambda x, y: x + y,
|
|
|
|
|
((path.join(x, "%s.tbz2" % z) for z
|
|
|
|
|
in os.listdir(path.join(dbPkg, x))) for x
|
|
|
|
|
in os.listdir(dbPkg)),
|
|
|
|
|
[])
|
|
|
|
|
# get binary packages
|
|
|
|
|
binList = \
|
|
|
|
|
reduce(lambda x, y: x + y,
|
|
|
|
|
map(lambda x: map(
|
|
|
|
|
lambda z: path.join(x, z)[len(pkgDir) + 1:],
|
|
|
|
|
os.listdir(path.join(x))),
|
|
|
|
|
filter(lambda x: path.isdir(x),
|
|
|
|
|
map(lambda x: path.join(pkgDir, x),
|
|
|
|
|
os.listdir(pkgDir)))), [])
|
|
|
|
|
|
|
|
|
|
binList = reduce(lambda x, y: x + y,
|
|
|
|
|
((path.join(x, y)[len(pkgDir) + 1:] for y
|
|
|
|
|
in os.listdir(path.join(x))) for x
|
|
|
|
|
in (z for z in (path.join(pkgDir, o) for o
|
|
|
|
|
in os.listdir(pkgDir))
|
|
|
|
|
if path.isdir(z))),
|
|
|
|
|
[])
|
|
|
|
|
# remove files which in binary and not in db/pkg
|
|
|
|
|
removeList = list(set(binList) - set(pkgList))
|
|
|
|
|
if removeList:
|
|
|
|
|
removelist_str = ",".join(
|
|
|
|
|
path.basename(x) for x in removeList)
|
|
|
|
|
logger.info(removelist_str)
|
|
|
|
|
map(lambda x: os.unlink(x),
|
|
|
|
|
map(lambda x: pathJoin(pkgDir, x),
|
|
|
|
|
removeList))
|
|
|
|
|
|
|
|
|
|
map(lambda x: os.unlink(x),
|
|
|
|
|
(pathJoin(pkgDir, x) for x in removeList))
|
|
|
|
|
|
|
|
|
|
# remove empty directories
|
|
|
|
|
map(lambda x: os.rmdir(x),
|
|
|
|
|
filter(lambda x: path.isdir(x) and not os.listdir(x),
|
|
|
|
|
map(lambda x: path.join(pkgDir, x),
|
|
|
|
|
os.listdir(pkgDir))))
|
|
|
|
|
map(lambda x: os.rmdir(x), (x for x in (path.join(pkgDir, y) for y
|
|
|
|
|
in os.listdir(pkgDir))
|
|
|
|
|
if path.isdir(x) and not os.listdir(x)))
|
|
|
|
|
|
|
|
|
|
self.regenPackages(chrootPath, pkgDir[len(chrootPath):])
|
|
|
|
|
except OSError as e:
|
|
|
|
@ -1562,7 +1558,7 @@ class Builder(Update):
|
|
|
|
|
for pathname, dirs, files in os.walk(devPath, topdown=False):
|
|
|
|
|
map(lambda x: os.unlink(path.join(pathname, x)), files)
|
|
|
|
|
map(lambda x: os.unlink(x) if path.islink(x) else os.rmdir(x),
|
|
|
|
|
map(lambda x: path.join(pathname, x), dirs))
|
|
|
|
|
(path.join(pathname, x) for x in dirs))
|
|
|
|
|
for node, mode, dmode, major, minor in [
|
|
|
|
|
("console", 0o600, stat.S_IFCHR, 5, 1),
|
|
|
|
|
("tty1", 0o600, stat.S_IFCHR, 4, 1),
|
|
|
|
@ -1962,10 +1958,12 @@ class Builder(Update):
|
|
|
|
|
if all(y not in pretend for y in x)]
|
|
|
|
|
required_pkgs = list(set(chain(*required_pkgs)))
|
|
|
|
|
|
|
|
|
|
clear_req_pkgs = list(filter(
|
|
|
|
|
None, [x.strip() for x in system_ini.getVar(
|
|
|
|
|
"automagic-clear",
|
|
|
|
|
package["CATEGORY/PN"]).split(",")]))
|
|
|
|
|
clear_req_pkgs = [x for x
|
|
|
|
|
in [x.strip() for x
|
|
|
|
|
in system_ini.getVar("automagic-clear",
|
|
|
|
|
package["CATEGORY/PN"]).split(",")]
|
|
|
|
|
if x]
|
|
|
|
|
|
|
|
|
|
waste_pkgs = [x for x in clear_req_pkgs if
|
|
|
|
|
all(y["CATEGORY/PN"] != x
|
|
|
|
|
for y in required_pkgs)]
|
|
|
|
|