TarBundle.py revision 2276
aead985e48027c9df1ef553b17df29dd378757aaJulian Kornberger# CDDL HEADER START
9c9b4f0d0199c3b1dbff564b87435b6693b7e692Julian Kornberger# The contents of this file are subject to the terms of the
b2dbef8c73faa240d208f3ff9fb49b21d9a894a5Daniel Vale# Common Development and Distribution License (the "License").
dda6f544eb58d850394073e34ae6127498869a77Christian Clausen# You may not use this file except in compliance with the License.
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller# or http://www.opensolaris.org/os/licensing.
dda6f544eb58d850394073e34ae6127498869a77Christian Clausen# See the License for the specific language governing permissions
0075dcb5aeeee4864fe9f64db82c8a8202bbe6d6henning mueller# and limitations under the License.
3cd45197413df1ff1401697720f1ac9ccef8f8eehenning mueller# When distributing Covered Code, include this CDDL HEADER in each
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller# If applicable, add the following below this CDDL HEADER, with the
ecf32c9d659a1f42c730d61eaa93583c095a4fddhenning mueller# fields enclosed by brackets "[]" replaced with your own identifying
a14e1ccbd2588441fb5a59e0c82f895b5c42c298Julian Kornberger# information: Portions Copyright [yyyy] [name of copyright owner]
0772cf7b22adf46dbab68e829d6a2cd8e8d1bc2ahenning mueller# CDDL HEADER END
7ea9649883e1bbe8f2582db1a3c66af8b7206056henning mueller# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
43a0f914166a28a9d7f75ab10673dce129cb38a9Julian Kornberger def __init__(self, filename, targetpaths=()):
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller # XXX This could be more intelligent. Or get user input. Or
b0ad67a7b41855a9148f346eb5b5d2b9276796ddhenning mueller # extend API to take FMRI.
8d4d8ac34f199d5c7d26694fabbfe2ab6bc0f9d9henning mueller return file.FileAction(tarfile.extractfile(tarinfo),