|
|
|
@ -1068,10 +1068,11 @@ class ArchiveDistributive(Distributive):
|
|
|
|
|
self.packToArchive(dFrom.directory, self.file)
|
|
|
|
|
|
|
|
|
|
class SquashDistributive(Distributive):
|
|
|
|
|
def __init__(self,file,parent=None,mdirectory="/mnt/livecd"):
|
|
|
|
|
def __init__(self,file,parent=None,mdirectory="/mnt/livecd",exclude=None):
|
|
|
|
|
Distributive.__init__(self,parent=parent)
|
|
|
|
|
self.file = file
|
|
|
|
|
self.mdirectory = mdirectory
|
|
|
|
|
self.exclude = [] if not exclude else exclude
|
|
|
|
|
|
|
|
|
|
def _mountSquash(self,file,directory):
|
|
|
|
|
"""Mount squashfs to directory"""
|
|
|
|
@ -1103,9 +1104,10 @@ class SquashDistributive(Distributive):
|
|
|
|
|
if not path.exists(mksquashfsUtil):
|
|
|
|
|
raise DistributiveError(_("Cann't create squash") +
|
|
|
|
|
" : %s"%_("command '%s' not found")%mksquashfsUtil)
|
|
|
|
|
processMkSquash = process(mksquashfsUtil,
|
|
|
|
|
"%s/"%directory,file,
|
|
|
|
|
"-no-progress","-e","usr/portage/EXCLUDE")
|
|
|
|
|
cmd = [mksquashfsUtil, "%s/"%directory,file, "-no-progress"]
|
|
|
|
|
if self.exclude:
|
|
|
|
|
cmd += ["-e"] + self.exclude
|
|
|
|
|
processMkSquash = process(*cmd)
|
|
|
|
|
if processMkSquash.failed():
|
|
|
|
|
raise DistributiveError(_("Cann't create squashfs") + " '%s':\n%s"%
|
|
|
|
|
(file,processMkSquash.read()))
|
|
|
|
@ -1119,7 +1121,7 @@ class SquashDistributive(Distributive):
|
|
|
|
|
|
|
|
|
|
class IsoDistributive(Distributive):
|
|
|
|
|
def __init__(self,file,parent=None,mdirectory="/mnt/cdrom",
|
|
|
|
|
bdirectory="/var/calculate/tmp/iso"):
|
|
|
|
|
bdirectory="/var/calculate/tmp/iso",exclude=None):
|
|
|
|
|
Distributive.__init__(self,parent=parent)
|
|
|
|
|
self.file = file
|
|
|
|
|
if path.isdir(self.file):
|
|
|
|
@ -1130,6 +1132,7 @@ class IsoDistributive(Distributive):
|
|
|
|
|
self.bdirectory = file
|
|
|
|
|
else:
|
|
|
|
|
self.bdirectory = self._getMntDirectory(bdirectory)
|
|
|
|
|
self.exclude = [] if not exclude else exclude
|
|
|
|
|
|
|
|
|
|
def _mountIso(self,file,directory):
|
|
|
|
|
if self.file != self.mdirectory:
|
|
|
|
@ -1156,7 +1159,7 @@ class IsoDistributive(Distributive):
|
|
|
|
|
raise DistributiveError(_("Iso %s doesn't contain live image") %
|
|
|
|
|
self.file)
|
|
|
|
|
return SquashDistributive(path.join(mdirectory,fileLive),
|
|
|
|
|
parent=self)
|
|
|
|
|
parent=self,exclude=self.exclude)
|
|
|
|
|
|
|
|
|
|
def getIsoContentDirectory(self):
|
|
|
|
|
"""Return directory with content of iso image"""
|
|
|
|
@ -1227,7 +1230,8 @@ class IsoDistributive(Distributive):
|
|
|
|
|
else:
|
|
|
|
|
distDirectory = source.convertToDirectory()
|
|
|
|
|
squashDistr = SquashDistributive(
|
|
|
|
|
path.join(isoDirectory,liveimage))
|
|
|
|
|
path.join(isoDirectory,liveimage),
|
|
|
|
|
exclude=self.exclude)
|
|
|
|
|
squashDistr.installFrom(distDirectory)
|
|
|
|
|
# prepare iso
|
|
|
|
|
self.prepareIso(isoDirectory)
|
|
|
|
|