directory.py revision 462
49N/A# The contents of this file are subject to the terms of the 49N/A# Common Development and Distribution License (the "License"). 49N/A# You may not use this file except in compliance with the License. 49N/A# See the License for the specific language governing permissions 49N/A# and limitations under the License. 49N/A# When distributing Covered Code, include this CDDL HEADER in each 49N/A# If applicable, add the following below this CDDL HEADER, with the 49N/A# fields enclosed by brackets "[]" replaced with your own identifying 49N/A# information: Portions Copyright [yyyy] [name of copyright owner] 289N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 49N/A# Use is subject to license terms. 49N/A"""module describing a directory packaging object 49N/AThis module contains the DirectoryAction class, which represents a 49N/Adirectory-type packaging object.""" 49N/A """Class representing a directory-type packaging object.""" 49N/A """Client-side method that installs a directory.""" 95N/A # XXX Hack! (See below comment.) 95N/A # The downside of chmodding the directory is that as a non-root 95N/A # user, if we set perms u-w, we won't be able to put anything in 95N/A # it, which is often not what we want at install time. We save 95N/A # the chmods for the postinstall phase, but it's always possible 95N/A # that a later package install will want to place something in 95N/A # this directory and then be unable to. So perhaps we need to 95N/A # (in all action types) chmod the parent directory to u+w on 95N/A # failure, and chmod it back aftwards. The trick is to 95N/A # recognize failure due to missing file_dac_write in contrast to 95N/A # other failures. Or can we require that everyone simply have 95N/A # file_dac_write who wants to use the tools. Probably not. 235N/A """ make sure directory is correctly installed""" 235N/A return [
"Directory does not exist"]
235N/A return [
"Skipping: Permission denied"]
235N/A return [
"Unexpected exception: %s" % e]
462N/A # cannot remove directory since it's