pkgplan.py revision 136
0N/A# The contents of this file are subject to the terms of the 0N/A# Common Development and Distribution License (the "License"). 0N/A# You may not use this file except in compliance with the License. 0N/A# See the License for the specific language governing permissions 0N/A# and limitations under the License. 0N/A# When distributing Covered Code, include this CDDL HEADER in each 0N/A# If applicable, add the following below this CDDL HEADER, with the 0N/A# fields enclosed by brackets "[]" replaced with your own identifying 0N/A# information: Portions Copyright [yyyy] [name of copyright owner] 0N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 0N/A# Use is subject to license terms. 2080N/A """A package plan takes two package FMRIs and an Image, and produces the 0N/A set of actions required to take the Image from the origin FMRI to the 0N/A If the destination FMRI is None, the package is removed. """Determine the actions required to transition the package.""" # if origin unset, determine if we're dealing with an previously # installed version or if we're dealing with the null package # XXX Perhaps make the pkgplan creator make this explicit, so we # Try to load the filter used for the last install of the l.
strip(),
"<filter string>",
"eval"))
# Assume that origin actions are unique, but make sure that """Perform actions required prior to installation or removal of a package. This method executes each action's preremove() or preinstall() methods, as well as any package-wide steps that need to be taken # Get any remaining files """Perform actions for installation or removal of a package. This method executes each action's remove() or install() # record that we are in an intermediate state # It might be nice to have a single action.execute() method, but # I can't think of an example where it would make especially # good sense (i.e., where "remove" is as similar to "upgrade" as print "Action install failed for '%s' (%s):\n %s: %s" % \
"""Perform actions required after installation or removal of a package. This method executes each action's postremove() or postinstall() methods, as well as any package-wide steps that need to be taken # record that package states are consistent # In the case of an upgrade, remove the installation turds from # the origin's directory. # XXX should this just go in preexecute? # Save the filters we used to install the package, so # they can be referenced later. """Create the reverse index databases for a particular package. These are the databases mapping packaging object attribute values back to their corresponding packages, allowing the packaging system to look up a package based on, say, the basename of a file that was installed. XXX Need a method to remove what we put down here. # If the value has slashes in it, link will be # that many directories further down, so we need # to add suffcient parent dirs to get back up to