|
|
|
@ -838,6 +838,10 @@ class Builder(Update):
|
|
|
|
|
self.clVars.Get('cl_builder_pkgdir'))
|
|
|
|
|
dbPkg = pathJoin(chrootPath, 'var/db/pkg')
|
|
|
|
|
|
|
|
|
|
logfile = self._get_log_file()
|
|
|
|
|
logger = log("binary_cleanpkg.log", filename=logfile,
|
|
|
|
|
formatter="%(asctime)s - %(message)s")
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
if not path.exists(dbPkg):
|
|
|
|
|
os.makedirs(dbPkg)
|
|
|
|
@ -860,9 +864,14 @@ class Builder(Update):
|
|
|
|
|
os.listdir(pkgDir)))),[])
|
|
|
|
|
|
|
|
|
|
# remove files which in binary and not in db/pkg
|
|
|
|
|
map(lambda x:os.unlink(x),
|
|
|
|
|
map(lambda x:pathJoin(pkgDir,x),
|
|
|
|
|
list(set(binList)-set(pkgList))))
|
|
|
|
|
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))
|
|
|
|
|
|
|
|
|
|
# remove empty directories
|
|
|
|
|
map(lambda x:os.rmdir(x),
|
|
|
|
|