Fix removing old squash images.

master
Mike Hiretsky 13 years ago
parent f7c6a747a1
commit d1b1c3fbda

@ -23,7 +23,7 @@ from os import access, R_OK,W_OK
from os import path
from cl_distr import Distributive
from cl_utils import getTupleVersion,genpassword,pathJoin,_toUNICODE, \
getFilesCount
getFilesCount,getCmdLineParam
from operator import itemgetter
from types import ListType
from cl_datavars import iniParser
@ -315,21 +315,18 @@ class fillVars(object, varsShare):
squashfiles = filter(lambda x:x,
map(Distributive.reLive.search,
os.listdir(directory)))
curName = self.Get('cl_builder_current_squash')
if squashfiles:
return map(lambda x:x.group(),
sorted(squashfiles, key=self.getSquashNum))[:-1]
return filter(lambda x:x != curName,
map(lambda x:x.group(),
sorted(squashfiles, key=self.getSquashNum)))
return ""
def get_cl_builder_current_squash(self):
"""Livecd.squashfs name (may be livecd.squashfs.2 and etc)"""
directory = self.Get('cl_builder_iso_path')
if not os.access(directory,R_OK):
return ""
squashfiles = filter(lambda x:x,
map(Distributive.reLive.search,
os.listdir(directory)))
if squashfiles:
return max(squashfiles, key=self.getSquashNum).group()
loopValue = getCmdLineParam('loop')
if loopValue:
return path.basename(loopValue)
return ""
def get_cl_builder_iso_path(self):

Loading…
Cancel
Save