Exemplo n.º 1
0
    def test(self):
        self.builder = buildercore(self.log)

        self.checkOptions()

        self.builder.readProject()
        print self.builder.projectinstall
        print type(self.builder.projectinstall)
        self.builder.installfiles = []
        for item in self.builder.projectinstall.split(','):
            self.builder.installfiles.append(item)
        print self.builder.installfiles
        print type(self.builder.installfiles)
Exemplo n.º 2
0
    def onInit(self):
        self.log = logging.getLogger(__name__)
        self.log.setLevel(logging.WARNING)
        self.log.addHandler(logging.NullHandler())

        self.builder = buildercore(self.log)

        self.installfiles = os.listdir(self.builder.custominstalldir)
        self.installfiles.sort()
        self.cl_install.Set(self.installfiles)
        self.scriptsinchrootfiles = os.listdir(self.builder.customscriptsinsidedir)
        self.scriptsinchrootfiles.sort()
        self.cl_scriptsinchroot.Set(self.scriptsinchrootfiles)
        self.scriptsoutchrootfiles = os.listdir(self.builder.customscriptsoutsidedir)
        self.scriptsoutchrootfiles.sort()
        self.cl_scriptsoutchroot.Set(self.scriptsoutchrootfiles)

##this to auto setup for testing - remove later
        self.onTest()
Exemplo n.º 3
0
    def run(self):
        self.builder = buildercore(self.log)

        self.checkOptions()

        self.builder.readProject()
        self.builder.distfullname = self.builder.projectdistfullname
        self.builder.distshortname = self.builder.projectdistshortname
        self.builder.distver = self.builder.projectdistver
        self.builder.distbranch = self.builder.projectbranch
        self.builder.distplatform = self.builder.projectplatform
        self.builder.distrepo = self.builder.projectrepo
        self.builder.distrepofile = self.builder.projectrepofile

        # stage 0 create basic dir setup
        self.builder.stage0setpaths()
        if os.path.exists(self.builder.livefspath):
            self.builder.stage0deletelivefspath()
            self.builder.stage0createlivefspath()
        else:
            self.builder.stage0createlivefspath()
        if os.path.exists(self.builder.liveisopath):
            self.builder.stage0deleteliveisopath()
            self.builder.stage0createliveisopath()
        else:
            self.builder.stage0createliveisopath()

        # stage 1 debootstrap
        self.builder.stage1createbasefrombootstrap()

        # stage 2 chroot
        self.builder.chrootcmdinitialsetup()
        self.builder.installfiles = []
        for item in self.builder.projectinstall.split(','):
            if os.path.isfile(self.builder.custominstalldir + item):
                self.builder.installfiles.append(item)
        self.builder.stage2packages()
        self.builder.scriptsinchrootfiles = []
        for item in self.builder.projectscriptsinchroot.split(','):
            if os.path.isfile(self.builder.customscriptsinsidedir + item):
                self.builder.scriptsinchrootfiles.append(item)
        self.builder.stage2scripts()
        self.builder.chrootcmdclose()
        self.builder.chrootcmdwrite()
        self.builder.chrootactionbuild()

        # stage 3 iso prep and other
        self.builder.stage3isofolders()
        if os.path.exists(self.builder.liveisopathlive):
            self.builder.stage3deleteisopathlive()
            self.builder.stage3createisopathlive()
        else:
            self.builder.stage3createisopathlive()

        if os.path.exists(self.builder.liveisopathisolinux):
            self.builder.stage3deleteisopathisolinux()
            self.builder.stage3createisopathisolinux()
        else:
            self.builder.stage3createisopathisolinux()
        self.builder.stage3files()
        self.builder.stage3cmdoutsideinit()
        self.builder.scriptsoutchrootfiles = []
        for item in self.builder.projectscriptsoutchroot.split(','):
            if os.path.isfile(self.builder.customscriptsoutsidedir + item):
                self.builder.scriptsoutchrootfiles.append(item)
        self.builder.stage3cmdoutsidescripts()
        self.builder.stage3cmdoutsidewrite()
        self.builder.stage3cmdoutsiderun()
        if os.path.isfile(self.builder.squashfsfile):
            os.remove(self.builder.squashfsfile)
            self.builder.squashfilesystem()
        else:
            self.builder.squashfilesystem()

        # stage 4 make iso
        self.builder.stage4createiso()

        self.log.warning('[ ] done')