Beispiel #1
0
    def run(self):
        """Remove a single package"""
        ctx.ui.notify(inary.ui.removing,
                      package=self.package,
                      files=self.files)
        ctx.ui.status(
            _("Removing \"{0.name}\", version {0.version}, release {0.release}"
              ).format(self.package),
            push_screen=False)

        if not self.installdb.has_package(self.package_name):
            ctx.ui.status(
                _('Trying to remove nonexistent package ') + self.package_name)

        self.check_dependencies()
        if not ctx.config.get_option(
                'ignore_configure') or ctx.config.get_option('destdir'):
            self.run_preremove()
        for fileinfo in self.files.list:
            self.remove_file(fileinfo, self.package_name, True)

        if not ctx.config.get_option(
                'ignore_configure') or ctx.config.get_option('destdir'):
            self.run_postremove()

        self.update_databases()

        self.remove_inary_files()
        ctx.ui.close()
        ctx.ui.notify(inary.ui.removed, package=self.package, files=self.files)
        util.xterm_title_reset()
Beispiel #2
0
    def run(self):
        self.init(database=True, write=False)

        from inary.file import File

        ctypes = {"bz2": File.COMPRESSION_TYPE_BZ2,
                  "xz": File.COMPRESSION_TYPE_XZ}
        compression = 0
        for type_str in ctx.get_option("compression_types").split(","):
            compression |= ctypes.get(type_str, 0)

        util.xterm_title(_("Taking inary repo index."))
        ctx.config.options.yes_all = True
        index.index(self.args or ["."], ctx.get_option('output'),
                    skip_sources=ctx.get_option('skip_sources'),
                    skip_signing=ctx.get_option('skip_signing'),
                    compression=compression)
        util.xterm_title_reset()
Beispiel #3
0
    def install(self, ask_reinstall=True):

        # Any package should remove the package it replaces before
        self.check_replaces()
        ctx.ui.status(_(
            "Installing \"{0.name}\", version {0.version}, release {0.release}"
        ).format(self.pkginfo),
                      push_screen=False)
        ctx.ui.notify(inary.ui.installing,
                      package=self.pkginfo,
                      files=self.files)

        ctx.ui.info(_("Checking package operation availability..."),
                    verbose=True)
        self.ask_reinstall = ask_reinstall
        ctx.ui.status(_("Checking requirements"), push_screen=False)
        self.check_requirements()
        ctx.ui.status(_("Checking versioning"), push_screen=False)
        self.check_versioning(self.pkginfo.version, self.pkginfo.release)
        ctx.ui.status(_("Checking relations"), push_screen=False)
        self.check_relations()
        ctx.ui.status(_("Checking operations"), push_screen=False)
        self.check_operation()

        # postOps from inary.operations.install and inary.operations.upgrade
        ctx.ui.status(_("Unpacking package"), push_screen=False)

        self.extract_install()

        ctx.ui.status(_("Updating database"), push_screen=False)
        self.store_inary_files()
        self.update_databases()
        ctx.ui.status(_("Syncing all buffers"), push_screen=False)
        util.fs_sync()

        ctx.ui.close()
        if self.operation == UPGRADE:
            event = inary.ui.upgraded
        else:
            event = inary.ui.installed
        ctx.ui.notify(event, package=self.pkginfo, files=self.files)
        util.xterm_title_reset()
Beispiel #4
0
 def close(self):
     util.xterm_title_reset()