예제 #1
0
def install(packages,
            reinstall=False,
            ignore_file_conflicts=False,
            ignore_package_conflicts=False):
    """
    Returns True if no errors occured during the operation
    @param packages: list of package names -> list_of_strings
    @param reinstall: reinstalls already installed packages else ignores
    @param ignore_file_conflicts: Ignores file conflicts during the installation and continues to install
    packages.
    @param ignore_package_conflicts: Ignores package conflicts during the installation and continues to
    install packages.
    """

    pisi.db.historydb.HistoryDB().create_history("install")

    if not ctx.get_option('ignore_file_conflicts'):
        ctx.set_option('ignore_file_conflicts', ignore_file_conflicts)

    if not ctx.get_option('ignore_package_conflicts'):
        ctx.set_option('ignore_package_conflicts', ignore_package_conflicts)

    # Install pisi package files or pisi packages from a repository
    if packages and packages[0].endswith(ctx.const.package_suffix):
        return pisi.operations.install.install_pkg_files(packages, reinstall)
    else:
        return pisi.operations.install.install_pkg_names(packages, reinstall)
예제 #2
0
def install(packages, reinstall=False, ignore_file_conflicts=False):
    """install a list of packages (either files/urls, or names)"""

    if not ctx.get_option("ignore_file_conflicts"):
        ctx.set_option("ignore_file_conflicts", ignore_file_conflicts)

    # determine if this is a list of files/urls or names
    if packages and packages[0].endswith(ctx.const.package_suffix):  # they all have to!
        return install_pkg_files(packages)
    else:
        return install_pkg_names(packages, reinstall)
예제 #3
0
    def run(self):
        self.init(database=False, write=False)
        ctx.set_option("ignore_build_no", True)
        if ctx.get_option("snapshot"):
            self.take_snapshot()
            return
        elif ctx.get_option("takeback"):
            opno = ctx.get_option("takeback")
            if opno != -1:
                self.takeback(opno)
                return

        self.redirect_output(self.print_history)
예제 #4
0
    def run(self):
        self.init(database = False, write = False)
        ctx.set_option('ignore_build_no', True)
        if ctx.get_option('snapshot'):
            self.take_snapshot()
            return
        elif ctx.get_option('takeback'):
            opno = ctx.get_option('takeback')
            if opno != -1:
                self.takeback(opno)
                return

        self.redirect_output()
        self.print_history()
예제 #5
0
def install(packages, reinstall = False, ignore_file_conflicts=False):
    """install a list of packages (either files/urls, or names)"""

    if not ctx.get_option('ignore_file_conflicts'):
        ctx.set_option('ignore_file_conflicts', ignore_file_conflicts)

    # FIXME: this function name "install" makes impossible to import
    # and use install module directly.
    from pisi.atomicoperations import Error as InstallError

    # determine if this is a list of files/urls or names
    if packages[0].endswith(ctx.const.package_suffix): # they all have to!
        return install_pkg_files(packages)
    else:
        return install_pkg_names(packages, reinstall)
예제 #6
0
def install(packages, reinstall=False, ignore_file_conflicts=False):
    """
    Returns True if no errors occured during the operation
    @param packages: list of package names -> list_of_strings
    @param reinstall: reinstalls already installed packages else ignores
    @param ignore_file_conflicts: Ignores file conflicts during the installation and continues to install
    packages.
    """

    historydb = pisi.db.historydb.HistoryDB().create("install")

    if not ctx.get_option('ignore_file_conflicts'):
        ctx.set_option('ignore_file_conflicts', ignore_file_conflicts)

    # Install pisi package files or pisi packages from a repository
    if packages and packages[0].endswith(ctx.const.package_suffix):
        return pisi.operations.install.install_pkg_files(packages)
    else:
        return pisi.operations.install.install_pkg_names(packages, reinstall)