pkgplan.py revision 60
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
import errno
import os
import re
import urllib
"""A package plan takes two package FMRIs and an Image, and produces the
set of actions required to take the Image from the origin FMRI to the
destination FMRI."""
self.origin_fmri = None
self.destination_fmri = None
self.origin_mfst = None
self.destination_mfst = None
fmri.get_dir_path())):
raise RuntimeError, "already installed"
if self.origin_fmri == None:
return True
return False
return False
return True
def get_actions(self):
return []
# if origin unset, determine if we're dealing with an previously
# installed version or if we're dealing with the null package
f = None
if self.origin_fmri == None:
try:
self.origin_fmri = f
except LookupError:
pass
# if null package, then our plan is the set of actions for the
# destination version
if self.origin_fmri == None:
else:
# if a previous package, then our plan is derived from
# the set differences between the previous manifest's
# actions and the union of the destination manifest's
# actions with the critical actions of the critical
# versions in the version interval between origin and
# destination.
return
def preexecute(self):
# retrieval step
return
# record that we are in an intermediate state
return
def postexecute(self):
# record that package states are consistent
a.postinstall()
if self.origin_fmri != None:
return
def make_indices(self):
"""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.
"""
gen = (
(k, v)
)
try:
except OSError, e:
raise
for v in val:
try:
except OSError, e:
raise