Beispiel #1
0
    def refresh(self):
        # We need to go through and delete packages in the pending actions
        # if they were going to be installed from a channel which no longer
        # exists.
        actions = (red_pendingops.TO_BE_INSTALLED,
                   red_pendingops.TO_BE_INSTALLED_CANCELLED)
        for pkg in red_pendingops.packages_with_actions(*actions):
            if not rcd_util.get_channel(pkg.get("channel", "")):
                red_pendingops.set_action(pkg, red_pendingops.NO_ACTION)

        self.changed(lambda x: x)  # noop
Beispiel #2
0
def run_transaction_cb(app):
    install_packages = red_pendingops.packages_with_actions(
        red_pendingops.TO_BE_INSTALLED)
    remove_packages = red_pendingops.packages_with_actions(
        red_pendingops.TO_BE_REMOVED)

    # FIXME: This feels like a hack.  Go through the remove_packages and
    # if any of them have an __old_package field, use that package for
    # the removal instead of the actual package.  This is so you can right
    # click on an upgrade and select "remove".
    remove_packages = [x.get("__old_package", x) for x in remove_packages]

    transaction_type = rcd_util.PACKAGE_TYPE_PACKAGE
    if len(install_packages) > 0:
        transaction_type = rcd_util.get_package_type(install_packages[0])
    elif len(remove_packages) > 0:
        transaction_type = rcd_util.get_package_type(remove_packages[0])

    dep_comp = red_depcomponent.DepComponent(install_packages, remove_packages,
                                             0, transaction_type)
    app.componentbook.push_component(dep_comp)
Beispiel #3
0
def run_transaction_cb(app):
    install_packages = red_pendingops.packages_with_actions(
        red_pendingops.TO_BE_INSTALLED)
    remove_packages = red_pendingops.packages_with_actions(
        red_pendingops.TO_BE_REMOVED)

    # FIXME: This feels like a hack.  Go through the remove_packages and
    # if any of them have an __old_package field, use that package for
    # the removal instead of the actual package.  This is so you can right
    # click on an upgrade and select "remove".
    remove_packages = [x.get("__old_package", x) for x in remove_packages]

    transaction_type = rcd_util.PACKAGE_TYPE_PACKAGE
    if len(install_packages) > 0:
        transaction_type = rcd_util.get_package_type(install_packages[0])
    elif len(remove_packages) > 0:
        transaction_type = rcd_util.get_package_type(remove_packages[0])

    dep_comp = red_depcomponent.DepComponent(install_packages,
                                             remove_packages,
                                             0,
                                             transaction_type)
    app.componentbook.push_component(dep_comp)
Beispiel #4
0
 def refresh_op(x):
     x.packages = red_pendingops.packages_with_actions()
Beispiel #5
0
 def __init__(self):
     self.packages = red_pendingops.packages_with_actions()
     red_packagearray.PackageArray.__init__(self)
     red_pendingops.PendingOpsListener.__init__(self)
     red_serverlistener.ServerListener.__init__(self)
     self.__pending = 0