Exemplo n.º 1
0
def main():
    if not os.path.exists(cache_dir):
        os.mkdir(cache_dir)

    logging.getLogger().setLevel(logging.INFO)

    name = ooblib.image_name()
    kspath = os.path.join(ooblib.intermediatesdir, 'build.ks')
    ks = imgcreate.read_kickstart(kspath)

    make_iso = ooblib.read_config_bool('base', 'make_iso')
    if make_iso:
        print "Building ISO image..."
        creator = imgcreate.LiveImageCreator(ks,
                                             name,
                                             name,
                                             tmpdir=ooblib.builddir,
                                             cacheonly=ooblib.cacheonly)
        compress = ooblib.read_config_bool('base', 'compress_iso')
        if compress is None:
            compress = False
        creator.skip_compression = not compress
    else:
        print "Building directly into FS image..."
        creator = imgcreate.LoopImageCreator(ks,
                                             'imgcreatefs',
                                             name,
                                             tmpdir=ooblib.builddir,
                                             cacheonly=ooblib.cacheonly)

    try:
        creator.mount(cachedir=cache_dir)
        creator.install()
        creator.configure()
        creator.unmount()
        if make_iso:
            creator.package(destdir=ooblib.outputdir)
        else:
            creator.package(destdir=ooblib.intermediatesdir)
    except imgcreate.CreatorError, e:
        logging.error("Error creating Live CD : %s" % e)
        return 1
def main():
    if not os.path.exists(cache_dir):
        os.mkdir(cache_dir)

    logging.getLogger().setLevel(logging.INFO)

    name = ooblib.image_name()
    kspath = os.path.join(ooblib.intermediatesdir, 'build.ks')
    ks = imgcreate.read_kickstart(kspath)

    make_iso = ooblib.read_config_bool('base', 'make_iso')
    if make_iso:
        print "Building ISO image..."
        creator = imgcreate.LiveImageCreator(ks, name, name,
                                             tmpdir=ooblib.builddir,
                                             cacheonly=ooblib.cacheonly)
        compress = ooblib.read_config_bool('base', 'compress_iso')
        if compress is None:
            compress = False
        creator.skip_compression = not compress
    else:
        print "Building directly into FS image..."
        creator = imgcreate.LoopImageCreator(ks, 'imgcreatefs', name,
                                             tmpdir=ooblib.builddir,
                                             cacheonly=ooblib.cacheonly)

    try:
        creator.mount(cachedir=cache_dir)
        creator.install()
        creator.configure()
        creator.unmount()
        if make_iso:
            creator.package(destdir=ooblib.outputdir)
        else:
            creator.package(destdir=ooblib.intermediatesdir)
    except imgcreate.CreatorError, e:
        logging.error("Error creating Live CD : %s" % e)
        return 1
Exemplo n.º 3
0
import urllib
import urllib2
import urlparse
import time
import pickle

from bitfrost.update import microformat

import ooblib

cache = os.path.join(ooblib.cachedir, 'activities')
if not os.path.exists(cache):
    os.makedirs(cache)

baseurl = ooblib.read_config('sugar_activity_group', 'url')
install_activities = ooblib.read_config_bool('sugar_activity_group',
                                             'install_activities')
systemwide = ooblib.read_config_bool('sugar_activity_group',
                                     'activity_group_systemwide')

if install_activities:
    vmaj = int(ooblib.read_config('global', 'olpc_version_major'))
    vmin = int(ooblib.read_config('global', 'olpc_version_minor'))
    vrel = int(ooblib.read_config('global', 'olpc_version_release'))

    suffixes = ["%d.%d.%d" % (vmaj, vmin, vrel), "%d.%d" % (vmaj, vmin), ""]

    for suffix in suffixes:
        if len(suffix) > 0:
            grpurl = urlparse.urljoin(baseurl + "/", urllib.quote(suffix))
            grpurlcache = os.path.join(cache, os.path.basename(baseurl)
                                              + '-' + suffix + ".html")