Kaydet (Commit) e3ce3524 authored tarafından Your Name's avatar Your Name

reconfigure eklendi. Boş args olursa hiçbişey yapmıyo

üst 08c93e8d
......@@ -51,6 +51,7 @@ import inary.cli.listrepo
import inary.cli.listsources
import inary.cli.listupgrades
import inary.cli.rebuilddb
import inary.cli.reconfigure
import inary.cli.remove
import inary.cli.removerepo
import inary.cli.removeorphaned
......
......@@ -36,7 +36,7 @@ dirs under /var/lib/inary
def __init__(self, args):
super(RebuildDb, self).__init__(args)
name = (_("rebuild-db"), "rdb")
name = (_("rebuild-db"), "rd")
def options(self):
group = optparse.OptionGroup(self.parser, _("rebuild-db options"))
......
# -*- coding:utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import optparse
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary.util as util
import inary.cli.command as command
import inary.ui
import inary.data
import inary.errors
import inary.context as ctx
import inary.reactor
def configure_pending(packages=None):
# start with pending packages
# configure them in reverse topological order of dependency
installdb = inary.db.installdb.InstallDB()
order=packages
if True:
for x in order:
if installdb.has_package(x):
pkginfo = installdb.get_package(x)
pkg_path = installdb.package_path(x)
m = inary.data.metadata.MetaData()
metadata_path = 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(inary.ui.configuring, package=pkginfo, files=None)
inary.reactor.post_install(
pkginfo.name,
m.package.providesScom,
util.join_path(pkg_path, ctx.const.scom_dir),
util.join_path(pkg_path, ctx.const.metadata_xml),
util.join_path(pkg_path, ctx.const.files_xml),
None,
None,
m.package.version,
m.package.release
)
ctx.ui.notify(inary.ui.configured, package=pkginfo, files=None)
installdb.clear_pending(x)
class ConfigurePending(command.PackageOp, metaclass=command.autocommand):
__doc__ = _("""Reconfigure pending packages
If SCOM configuration of some packages were not
done at installation time, they are added to a list
of packages waiting to be configured. This command
configures those packages.
""")
def __init__(self, args):
super(ConfigurePending, self).__init__(args)
name = (_("reconfigure"), "rp")
def options(self):
group = optparse.OptionGroup(self.parser, _("configure-pending options"))
super(ConfigurePending, self).options(group)
self.parser.add_option_group(group)
def run(self):
self.init(database=True, write=False)
configure_pending(self.args)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment