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