def install(self, ask_reinstall = True):

        # Any package should remove the package it replaces before
        self.check_replaces()

        ctx.ui.status(_('Installing %s, version %s, release %s, build %s') %
                (self.pkginfo.name, self.pkginfo.version,
                 self.pkginfo.release, self.pkginfo.build))
        ctx.ui.notify(pisi.ui.installing, package=self.pkginfo, files=self.files)

        self.ask_reinstall = ask_reinstall
        self.check_requirements()
        self.check_versioning("%s-%s" % (self.pkginfo.version, self.pkginfo.release))
        self.check_relations()
        self.check_operation()
        self.extract_install()

        ctx.disable_keyboard_interrupts()
        self.store_pisi_files()
        self.postinstall()

        self.update_databases()

        ctx.enable_keyboard_interrupts()

        ctx.ui.close()
        if self.operation == UPGRADE:
            event = pisi.ui.upgraded
        else:
            event = pisi.ui.installed
        ctx.ui.notify(event, package = self.pkginfo, files = self.files)
Example #2
0
def finalize():
    if ctx.initialized:
        ctx.disable_keyboard_interrupts()
        if ctx.log:
            ctx.loghandler.flush()
            ctx.log.removeHandler(ctx.loghandler)

        pisi.repodb.finalize()
        pisi.installdb.finalize()
        if ctx.filesdb != None:
            ctx.filesdb.close()
            ctx.filesdb = None
        if ctx.componentdb != None:
            ctx.componentdb.close()
            ctx.componentdb = None
        if ctx.packagedb:
            packagedb.finalize_db()
            ctx.packagedb = None
        if ctx.sourcedb:
            pisi.sourcedb.finalize()
            ctx.sourcedb = None
        pisi.search.finalize()
        if ctx.dbenv:
            ctx.dbenv.close()
            ctx.dbenv_lock.close()
        if ctx.build_leftover and os.path.exists(ctx.build_leftover):
            os.unlink(ctx.build_leftover)

        ctx.ui.debug('PiSi API finalized')
        ctx.ui.close()
        ctx.initialized = False
        ctx.enable_keyboard_interrupts()
    def install(self, ask_reinstall=True):

        # Any package should remove the package it replaces before
        self.check_replaces()

        ctx.ui.status(
            _('Installing %s, version %s, release %s') %
            (self.pkginfo.name, self.pkginfo.version, self.pkginfo.release))
        ctx.ui.notify(pisi.ui.installing,
                      package=self.pkginfo,
                      files=self.files)

        self.ask_reinstall = ask_reinstall
        self.check_requirements()
        self.check_versioning(self.pkginfo.version, self.pkginfo.release)
        self.check_relations()
        self.check_operation()

        ctx.disable_keyboard_interrupts()

        self.extract_install()
        self.store_pisi_files()
        self.postinstall()
        self.update_databases()

        ctx.enable_keyboard_interrupts()

        ctx.ui.close()
        if self.operation == UPGRADE:
            event = pisi.ui.upgraded
        else:
            event = pisi.ui.installed
        ctx.ui.notify(event, package=self.pkginfo, files=self.files)
    def install(self, ask_reinstall = True):
        if ctx.get_option('fetch_only'):
            return

        ctx.ui.status(_('Installing %s, version %s, release %s, build %s') %
                (self.pkginfo.name, self.pkginfo.version,
                 self.pkginfo.release, self.pkginfo.build))
        ctx.ui.notify(pisi.ui.installing, package=self.pkginfo, files=self.files)

        self.ask_reinstall = ask_reinstall
        self.check_requirements()
        self.check_relations()
        self.check_operation()
        self.extract_install()

        ctx.disable_keyboard_interrupts()
        self.store_pisi_files()
        self.postinstall()

        self.update_databases()

        ctx.enable_keyboard_interrupts()

        ctx.ui.close()
        if self.operation == UPGRADE:
            event = pisi.ui.upgraded
        else:
            event = pisi.ui.installed
        ctx.ui.notify(event, package = self.pkginfo, files = self.files)
Example #5
0
    def install(self, ask_reinstall=True):
        if ctx.get_option('fetch_only'):
            return

        ctx.ui.status(
            _('Installing %s, version %s, release %s, build %s') %
            (self.pkginfo.name, self.pkginfo.version, self.pkginfo.release,
             self.pkginfo.build))
        ctx.ui.notify(pisi.ui.installing,
                      package=self.pkginfo,
                      files=self.files)

        self.ask_reinstall = ask_reinstall
        self.check_requirements()
        self.check_relations()
        self.check_operation()
        self.extract_install()

        ctx.disable_keyboard_interrupts()
        self.store_pisi_files()
        self.postinstall()

        self.update_databases()

        ctx.enable_keyboard_interrupts()

        ctx.ui.close()
        if self.operation == UPGRADE:
            event = pisi.ui.upgraded
        else:
            event = pisi.ui.installed
        ctx.ui.notify(event, package=self.pkginfo, files=self.files)
Example #6
0
def _cleanup():
    """Close the database cleanly and do other cleanup."""
    ctx.disable_keyboard_interrupts()
    if ctx.log:
        ctx.loghandler.flush()
        ctx.log.removeHandler(ctx.loghandler)

    filesdb = pisi.db.filesdb.FilesDB()
    if filesdb.is_initialized():
        filesdb.close()

    if ctx.build_leftover and os.path.exists(ctx.build_leftover):
        os.unlink(ctx.build_leftover)

    ctx.ui.close()
    ctx.enable_keyboard_interrupts()
Example #7
0
def _cleanup():
    """Close the database cleanly and do other cleanup."""
    ctx.disable_keyboard_interrupts()
    if ctx.log:
        ctx.loghandler.flush()
        ctx.log.removeHandler(ctx.loghandler)

    filesdb = pisi.db.filesdb.FilesDB()
    if filesdb.is_initialized():
        filesdb.close()

    if ctx.build_leftover and os.path.exists(ctx.build_leftover):
        os.unlink(ctx.build_leftover)

    ctx.ui.close()
    ctx.enable_keyboard_interrupts()