pkgplan.py revision 956
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] 289N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 50N/A# Use is subject to license terms. 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. 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.""" 50N/A # if origin unset, determine if we're dealing with an previously 50N/A # installed version or if we're dealing with the null package 66N/A # XXX Perhaps make the pkgplan creator make this explicit, so we 66N/A # don't have to check? 111N/A # Assume that origin actions are unique, but make sure that 111N/A # destination ones are. 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 400N/A # Stash information needed by legacy actions. 583N/A # Add any repair actions to the update list 400N/A # We cross a point of no return here, and throw away the origin 400N/A # and destination manifests. This is really important for 400N/A """ Returns information needed by the legacy action to 400N/A populate the SVR4 packaging info. """ 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 481N/A """Download data for any actions that need it.""" 237N/A """ perform action for installation of package""" 384N/A msg(
"Action install failed for '%s' (%s):\n %s: %s" % \
237N/A """ handle action updates""" 384N/A msg(
"Action upgrade failed for '%s' (%s):\n %s: %s" % \
237N/A """ handle action removals""" 384N/A msg(
"Action removal failed for '%s' (%s):\n %s: %s" % \
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 481N/A # For an uninstall or an upgrade, remove the installation 481N/A # turds from the origin's directory. 66N/A # XXX should this just go in preexecute? 111N/A # Save the filters we used to install the package, so 111N/A # they can be referenced later.