pkgplan.py revision 258
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] 926N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 926N/A# Use is subject to license terms. 51N/A """A package plan takes two package FMRIs and an Image, and produces the 1352N/A set of actions required to take the Image from the origin FMRI to the 1352N/A If the destination FMRI is None, the package is removed. 39N/A #XXX this is busted, can't work self.origin_mfst = manifest.retrieve(fmri) 315N/A """Determine the actions required to transition the package.""" 39N/A # if origin unset, determine if we're dealing with an previously 227N/A # installed version or if we're dealing with the null package 315N/A # XXX Perhaps make the pkgplan creator make this explicit, so we 39N/A # don't have to check? 1352N/A # Try to load the filter used for the last install of the 1045N/A # Assume that origin actions are unique, but make sure that 72N/A # over the list of update actions, check for any that are the 59N/A # target of hardlink actions, and add the renewal of those hardlinks 72N/A # to the install set 72N/A # iterate over copy since we're appending to list 838N/A """Perform actions required prior to installation or removal of a package. 926N/A This method executes each action's preremove() or preinstall() 926N/A methods, as well as any package-wide steps that need to be taken 181N/A # Get any remaining files 615N/A """ perform action for installation of package""" 615N/A print "Action install failed for '%s' (%s):\n %s: %s" % \
111N/A """ handle action updates""" 111N/A print "Action upgrade failed for '%s' (%s):\n %s: %s" % \
113N/A """ handle action removals""" 113N/A print "Action removal failed for '%s' (%s):\n %s: %s" % \
39N/A """Perform actions required after installation or removal of a package. 926N/A This method executes each action's postremove() or postinstall() 926N/A methods, as well as any package-wide steps that need to be taken 926N/A # record that package states are consistent 72N/A # In the case of an upgrade, remove the installation turds from 72N/A # the origin's directory. 72N/A # XXX should this just go in preexecute? 1085N/A # Save the filters we used to install the package, so 1085N/A # they can be referenced later.