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