pkgplan.py revision 66
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] 50N/A# Copyright 2007 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. 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? 50N/A # if null package, then our plan is the set of actions for the 50N/A # destination version 59N/A # if a previous package, then our plan is derived from 59N/A # the set differences between the previous manifest's 59N/A # actions and the union of the destination manifest's 59N/A # actions with the critical actions of the critical 59N/A # versions in the version interval between origin and 66N/A """Perform actions required prior to installation or removal of a package. 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 66N/A """Perform actions for installation or removal of a package. 66N/A This method executes each action's remove() or install() 66N/A # record that we are in an intermediate state 66N/A """Perform actions required after installation or removal of a package. 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 66N/A # XXX should this just go in preexecute? 60N/A """Create the reverse index databases for a particular package. 60N/A These are the databases mapping packaging object attribute 60N/A values back to their corresponding packages, allowing the 60N/A packaging system to look up a package based on, say, the 60N/A basename of a file that was installed. 60N/A XXX Need a method to remove what we put down here. 66N/A # XXX bail out, for now.