pkgplan.py revision 2446
50N/A# The contents of this file are subject to the terms of the 50N/A# Common Development and Distribution License (the "License"). 50N/A# You may not use this file except in compliance with the License. 50N/A# See the License for the specific language governing permissions 50N/A# and limitations under the License. 50N/A# When distributing Covered Code, include this CDDL HEADER in each 50N/A# If applicable, add the following below this CDDL HEADER, with the 50N/A# fields enclosed by brackets "[]" replaced with your own identifying 50N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2205N/A# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 50N/A """A package plan takes two package FMRIs and an Image, and produces the 50N/A set of actions required to take the Image from the origin FMRI to the 66N/A If the destination FMRI is None, the package is removed. 2205N/A "actions",
"check_cancelation",
"destination_fmri",
"image",
2205N/A "origin_fmri",
"pkg_summary",
"__destination_mfst",
1846N/A "__license_status",
"__origin_mfst",
"__progtrack",
2205N/A "__repair_actions",
"__xferfiles",
"__xfersize",
2293N/A "_autofix_pkgs",
"__executed" 1618N/A """Adds a license status entry for the given src and dest 1618N/A 'src' should be None or the source action for a license. 1618N/A 'dest' must be the destination action for a license.""" 2339N/A """Return a list of pickled actions.""" 2339N/A """Return a list of unpickled actions.""" 2339N/A """Update the state of this object using the contents of 2339N/A the supplied dictionary.""" 2339N/A # if there is no origin, don't allocate an fmri obj 2339N/A # if there is no destination, don't allocate an fmri obj 2339N/A """Returns a dictionary containing the state of this object 2339N/A so that it can be easily stored using JSON, pickle, etc.""" 1505N/A """Propose origin and dest fmri, manifest""" 1505N/A # I'd like a cleaner solution than this; we need to actually 1505N/A # construct a list of actions as things currently are rather than 1505N/A # just re-applying the current set of actions. 583N/A # Create a list of (src, dst) pairs for the actions to send to 583N/A # execute_repair. src is none in this case since we aren't 583N/A # upgrading, just repairing. 583N/A # Only install actions, no update or remove 307N/A """ updates a set of installed fmris to reflect 66N/A """Determine the actions required to transition the package.""" 2026N/A # If new actions are being installed, check the destination 2261N/A # Since user removed publisher, assume this is 2261N/A # the same as if they had set signature-policy 2261N/A # ignore for the publisher. 2261N/A # Only perform signature verification logic if 2261N/A # there are signatures or if signature-policy 307N/A # figure out how many implicit directories disappear in this 307N/A # transition and add directory remove actions. These won't 307N/A # do anything unless no pkgs reference that directory in 1045N/A # Retrieving origin_dirs first and then checking it for any 1045N/A # entries allows avoiding an unnecessary expanddirs for the 1045N/A # destination manifest when it isn't needed. 2277N/A # Manifest.get_directories() returns implicit directories, which 2277N/A # means that this computation ends up re-adding all the explicit 2277N/A # directories getting removed to the removed list. This is 400N/A # Stash information needed by legacy actions. 583N/A # Add any repair actions to the update list 2117N/A # Never assume acceptance for 2117N/A # If src action required acceptance, 2117N/A # then license was already accepted 2117N/A # before, and if the hashes are the 2117N/A # same for the license payload, then 2117N/A # it doesn't need to be accepted again. 1618N/A """A generator function that yields tuples of the form (license, 1618N/A entry). Where 'entry' is a dict containing the license status 1618N/A """Sets the license status for the given license entry. 1618N/A 'plicense' should be the value of the license attribute for the 1618N/A destination license action. 1618N/A 'accepted' is an optional parameter that can be one of three 1618N/A None leaves accepted status unchanged 1618N/A False sets accepted status to False 1618N/A True sets accepted status to True 1618N/A 'displayed' is an optional parameter that can be one of three 1618N/A None leaves displayed status unchanged 1618N/A False sets displayed status to False 1618N/A True sets displayed status to True""" 2407N/A """Return tuple of compressed bytes possibly downloaded 2407N/A and number of bytes laid down; ignore removals 2407N/A because they're usually pinned by snapshots""" 388N/A """Perform actions required prior to installation or removal of 66N/A This method executes each action's preremove() or preinstall() 66N/A methods, as well as any package-wide steps that need to be taken 1618N/A # Determine if license acceptance requirements have been met as 481N/A """Download data for any actions that need it.""" 237N/A """ perform action for installation of package""" 1755N/A # Don't log these as they're expected, and should be 1618N/A """ handle action updates""" 1755N/A # Don't log these as they're expected, and should be 237N/A """ handle action removals""" 1755N/A # Don't log these as they're expected, and should be 400N/A """Perform actions required after install or remove of a pkg. 66N/A This method executes each action's postremove() or postinstall() 66N/A methods, as well as any package-wide steps that need to be taken 66N/A # record that package states are consistent 2293N/A """Used to save unexpected files or directories found during 2293N/A plan execution. Salvaged items are tracked in the imageplan.