Example #1
0
def info_name(package_name, useinstalldb=False):
    """Fetch package information for the given package."""

    installdb = pisi.db.installdb.InstallDB()
    packagedb = pisi.db.packagedb.PackageDB()
    if useinstalldb:
        package = installdb.get_package(package_name)
        repo = None
    else:
        package, repo = packagedb.get_package_repo(package_name)

    metadata = pisi.metadata.MetaData()
    metadata.package = package
    #FIXME: get it from sourcedb if available
    metadata.source = None
    #TODO: fetch the files from server if possible (wow, you maniac -- future exa)
    if useinstalldb and installdb.has_package(package.name):
        try:
            files = installdb.get_files(package.name)
        except pisi.Error as e:
            ctx.ui.warning(e)
            files = None
    else:
        files = None
    return metadata, files, repo
Example #2
0
def configure_pending(packages=None):
    # Import COMAR
    import pisi.comariface

    # start with pending packages
    # configure them in reverse topological order of dependency
    installdb = pisi.db.installdb.InstallDB()
    if not packages:
        packages = installdb.list_pending()
    else:
        packages = set(packages).intersection(installdb.list_pending())

    order = generate_pending_order(packages)
    try:
        for x in order:
            if installdb.has_package(x):
                pkginfo = installdb.get_package(x)
                pkg_path = installdb.package_path(x)
                m = pisi.metadata.MetaData()
                metadata_path = pisi.util.join_path(pkg_path,
                                                    ctx.const.metadata_xml)
                m.read(metadata_path)
                # FIXME: we need a full package info here!
                pkginfo.name = x
                ctx.ui.notify(pisi.ui.configuring, package=pkginfo, files=None)
                pisi.comariface.post_install(
                    pkginfo.name, m.package.providesComar,
                    pisi.util.join_path(pkg_path, ctx.const.comar_dir),
                    pisi.util.join_path(pkg_path, ctx.const.metadata_xml),
                    pisi.util.join_path(pkg_path, ctx.const.files_xml), None,
                    None, m.package.version, m.package.release)
                ctx.ui.notify(pisi.ui.configured, package=pkginfo, files=None)
            installdb.clear_pending(x)
    except ImportError:
        raise pisi.Error(_("comar package is not fully installed"))
Example #3
0
def configure_pending(packages=None):
    # start with pending packages
    # configure them in reverse topological order of dependency
    installdb = pisi.db.installdb.InstallDB()
    if not packages:
        packages = installdb.list_pending()
    else:
        packages = set(packages).intersection(installdb.list_pending())

    try:
        ctx.exec_usysconf()
    except Exception as e:
        raise e
        return

    # Clear legacy "needs configuration" flag
    order = generate_pending_order(packages)
    for x in order:
        if installdb.has_package(x):
            pkginfo = installdb.get_package(x)
            pkg_path = installdb.package_path(x)
            m = pisi.metadata.MetaData()
            metadata_path = pisi.util.join_path(pkg_path, ctx.const.metadata_xml)
            m.read(metadata_path)
            # FIXME: we need a full package info here!
            pkginfo.name = x
            ctx.ui.notify(pisi.ui.configuring, package = pkginfo, files = None)
            ctx.ui.notify(pisi.ui.configured, package = pkginfo, files = None)
        installdb.clear_pending(x)
Example #4
0
def configure_pending(packages=None):
    # start with pending packages
    # configure them in reverse topological order of dependency
    installdb = pisi.db.installdb.InstallDB()
    if not packages:
        packages = installdb.list_pending()
    else:
        packages = set(packages).intersection(installdb.list_pending())

    try:
        ctx.exec_usysconf()
    except Exception as e:
        raise e
        return

    # Clear legacy "needs configuration" flag
    order = generate_pending_order(packages)
    for x in order:
        if installdb.has_package(x):
            pkginfo = installdb.get_package(x)
            pkg_path = installdb.package_path(x)
            m = pisi.metadata.MetaData()
            metadata_path = pisi.util.join_path(pkg_path, ctx.const.metadata_xml)
            m.read(metadata_path)
            # FIXME: we need a full package info here!
            pkginfo.name = x
            ctx.ui.notify(pisi.ui.configuring, package = pkginfo, files = None)
            ctx.ui.notify(pisi.ui.configured, package = pkginfo, files = None)
        installdb.clear_pending(x)
Example #5
0
def configure_pending(packages=None):
    # Import COMAR
    import pisi.comariface

    # start with pending packages
    # configure them in reverse topological order of dependency
    installdb = pisi.db.installdb.InstallDB()
    if not packages:
        packages = installdb.list_pending()
    else:
        packages = set(packages).intersection(installdb.list_pending())

    order = generate_pending_order(packages)
    try:
        for x in order:
            if installdb.has_package(x):
                pkginfo = installdb.get_package(x)
                pkgname = pisi.util.package_name(x, pkginfo.version,
                                        pkginfo.release,
                                        False,
                                        False)
                pkg_path = pisi.util.join_path(ctx.config.packages_dir(), pkgname)
                m = pisi.metadata.MetaData()
                metadata_path = pisi.util.join_path(pkg_path, ctx.const.metadata_xml)
                m.read(metadata_path)
                # FIXME: we need a full package info here!
                pkginfo.name = x
                ctx.ui.notify(pisi.ui.configuring, package = pkginfo, files = None)
                pisi.comariface.post_install(
                    pkginfo.name,
                    m.package.providesComar,
                    pisi.util.join_path(pkg_path, ctx.const.comar_dir),
                    pisi.util.join_path(pkg_path, ctx.const.metadata_xml),
                    pisi.util.join_path(pkg_path, ctx.const.files_xml),
                    None,
                    None,
                    m.package.version,
                    m.package.release
                )
                ctx.ui.notify(pisi.ui.configured, package = pkginfo, files = None)
            installdb.clear_pending(x)
    except ImportError:
        raise pisi.Error(_("comar package is not fully installed"))
Example #6
0
def info_name(package_name, useinstalldb=False):
    """Fetch package information for the given package."""

    installdb = pisi.db.installdb.InstallDB()
    packagedb = pisi.db.packagedb.PackageDB()
    if useinstalldb:
        package = installdb.get_package(package_name)
        repo = None
    else:
        package, repo = packagedb.get_package_repo(package_name)

    metadata = pisi.metadata.MetaData()
    metadata.package = package
    #FIXME: get it from sourcedb if available
    metadata.source = None
    #TODO: fetch the files from server if possible (wow, you maniac -- future exa)
    if useinstalldb and installdb.has_package(package.name):
        try:
            files = installdb.get_files(package.name)
        except pisi.Error, e:
            ctx.ui.warning(e)
            files = None