DirectoryBundle.py revision 1955
565N/A# The contents of this file are subject to the terms of the 565N/A# Common Development and Distribution License (the "License"). 565N/A# You may not use this file except in compliance with the License. 565N/A# See the License for the specific language governing permissions 565N/A# and limitations under the License. 565N/A# When distributing Covered Code, include this CDDL HEADER in each 565N/A# If applicable, add the following below this CDDL HEADER, with the 565N/A# fields enclosed by brackets "[]" replaced with your own identifying 565N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3020N/A# Copyright (c) 2008, 2010 Oracle and/or its affiliates. All rights reserved. 926N/A """The DirectoryBundle class assists in the conversion of a directory 926N/A tree to a pkg(5) package by traversing the tree and emitting actions for 838N/A all files, directories, and links found therein. 2034N/A Paths are published relative to the given directory. Hardlinks are 2034N/A resolved as long as their companions are in the tree as well. 1540N/A All owners are set to "root" and groups to "bin", as the ownership 1540N/A information is not considered to be valid. These can be set by the 1540N/A caller once the action has been emitted. 1540N/A # XXX This could be more intelligent. Or get user input. Or 2339N/A # Pre-populate self.inodes with the paths of known targets 2524N/A # Any inode in self.inodes will either have been visited 2524N/A # before or will have been pre-populated from the list 2524N/A # of known targets. Create file actions for known 2524N/A # targets and unvisited inodes. 2524N/A # Find the relative path to the link target.