|
|
|
@ -30,7 +30,7 @@ from cl_utils import process,pathJoin,getRunCommands,getTupleVersion,\
|
|
|
|
|
from subprocess import STDOUT,PIPE
|
|
|
|
|
from cl_print import color_print
|
|
|
|
|
from cl_datavars import DataVars
|
|
|
|
|
from shutil import copy2 as copy_with_perm
|
|
|
|
|
from shutil import copy2 as copy_with_perm, rmtree
|
|
|
|
|
from cl_distr import IsoDistributive, DirectoryDistributive, \
|
|
|
|
|
DistributiveError
|
|
|
|
|
from cl_template import template,iniParser
|
|
|
|
@ -44,6 +44,7 @@ import cl_overriding
|
|
|
|
|
import hashlib
|
|
|
|
|
from cl_lang import lang
|
|
|
|
|
lang().setLanguage(sys.modules[__name__])
|
|
|
|
|
from itertools import *
|
|
|
|
|
|
|
|
|
|
class printNoColor:
|
|
|
|
|
def colorPrint(self,attr,fg,bg,string):
|
|
|
|
@ -306,12 +307,28 @@ class cl_builder(color_print):
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def clearPortage(self,mp):
|
|
|
|
|
"""
|
|
|
|
|
Clear portages (remove all directories exclude distfiles,
|
|
|
|
|
eclass,profiles
|
|
|
|
|
"""
|
|
|
|
|
for ebuilds in ("usr/portage","var/lib/layman/calculate"):
|
|
|
|
|
for rmPath in imap(lambda x:path.join(mp,ebuilds,x),
|
|
|
|
|
ifilterfalse(('distfiles','eclass',
|
|
|
|
|
'profiles','.git').__contains__,
|
|
|
|
|
listDirectory(path.join(mp,ebuilds)))):
|
|
|
|
|
if path.isdir(rmPath):
|
|
|
|
|
rmtree(rmPath)
|
|
|
|
|
else:
|
|
|
|
|
os.unlink(rmPath)
|
|
|
|
|
|
|
|
|
|
def prepareSourceDistributive(self,distr):
|
|
|
|
|
"""Unmount all bind,proc mount points from source distribute"""
|
|
|
|
|
mp = self.clVars.Get('cl_builder_path')
|
|
|
|
|
createdDev = self.createUrandom(mp)
|
|
|
|
|
self.dispatchConf(mp)
|
|
|
|
|
self.updatePortage(mp)
|
|
|
|
|
self.clearPortage(mp)
|
|
|
|
|
self.updateMan(mp)
|
|
|
|
|
self.removeUrandom(mp,createdDev)
|
|
|
|
|
|
|
|
|
|