pkgrepo.py revision 2510
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# CDDL HEADER START
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# The contents of this file are subject to the terms of the
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# Common Development and Distribution License (the "License").
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# You may not use this file except in compliance with the License.
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# See the License for the specific language governing permissions
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# and limitations under the License.
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# When distributing Covered Code, include this CDDL HEADER in each
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# If applicable, add the following below this CDDL HEADER, with the
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# fields enclosed by brackets "[]" replaced with your own identifying
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# information: Portions Copyright [yyyy] [name of copyright owner]
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# CDDL HEADER END
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# pkgrepo exit codes
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch# listing constants
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan BoschLISTING_FORMATS = ("json", "json-formatted", "tsv")
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschimport pkg.client.transport.transport as transport
def cleanup():
for d in tmpdirs:
if cmd:
if quiet:
progtrack = \
progtrack = \
return progtrack
if usage_error:
if not full:
if not pargs:
return EXIT_OOPS
if dry_run:
return EXIT_OK
return EXIT_OK
if not path:
if not repo_uri:
if not repo_uri:
if not pargs:
if abort:
return EXIT_OOPS
new_pubs = [
if make_default:
if new_pubs:
return EXIT_PARTIAL
return EXIT_OOPS
return rval
version = None
except ValueError:
elif pargs:
if not repo_uri:
return EXIT_OK
return EXIT_OOPS
if pubs:
del props
def gen_listing():
field_data = {
return EXIT_PARTIAL
return EXIT_OOPS
return EXIT_OK
if use_transport:
for p in pub_data:
return EXIT_OOPS, None, None
pargs):
return rval
pub_idx = {}
if pub_repo:
del props
def gen_listing():
field_data = {
return rval
return EXIT_OOPS
if pargs:
def gen_listing():
if last_update:
field_data = {
return EXIT_PARTIAL
return EXIT_OOPS
return EXIT_OK
return EXIT_OOPS
return rval
listed = {}
def gen_listing():
if not listed:
state = None
ret = {
yield ret
field_data = {
if not unmatched:
return EXIT_OOPS
elif unmatched:
return EXIT_PARTIAL
return EXIT_OK
if pargs:
return EXIT_OK
elif build_catalog:
elif build_index:
xpub)
return rval
return rval
if pargs:
return EXIT_OK
elif add_content:
elif refresh_index:
xpub)
return rval
return rval
props = {}
if not pargs:
except ValueError:
if bad_args:
if pubs:
if not pubs:
failed = []
if not target:
val = []
if new_pub:
if failed:
return EXIT_PARTIAL
return EXIT_OOPS
return EXIT_OK
return EXIT_OK
if args:
return EXIT_OK
def main_func():
conf = {}
subcommand = None
if pargs:
if show_usage:
elif not subcommand:
if not func:
raise __e
return __ret
except IOError: