pkgrepo.py revision 3171
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# CDDL HEADER START
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# The contents of this file are subject to the terms of the
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# Common Development and Distribution License (the "License").
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# You may not use this file except in compliance with the License.
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# See the License for the specific language governing permissions
74ae32512357bdd4872bf160dc697ff7b54b54c5Timo Sirainen# and limitations under the License.
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# If applicable, add the following below this CDDL HEADER, with the
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainen# CDDL HEADER END
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
9625595c47c665f5aee57ebfcb1fcbe9ad1bf3a0Martti Rannanjärvi# pkgrepo exit codes
tmpdirs = []
import atexit
import collections
import copy
import errno
import getopt
import gettext
import locale
import logging
import os
import shlex
import shutil
import sys
import tempfile
import textwrap
import traceback
import warnings
import itertools
import pkg
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:
global tmpdirs
if not prefix:
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
if not repo_uri:
if not pargs:
inv_pfxs = []
if inv_pfxs:
return EXIT_OOPS
if noexisting:
return EXIT_OOPS
if dry_run:
return EXIT_OK
return EXIT_OK
version = None
except ValueError:
elif pargs:
if not repo_uri:
return EXIT_OK
key = None
cert = None
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
key = None
cert = None
if pargs:
def gen_listing():
if last_update:
field_data = {
return EXIT_PARTIAL
return EXIT_OOPS
return EXIT_OK
key = None
cert = None
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
global tmpdirs
key = None
cert = None
attrs = []
action_types = []
return rval
manifests = []
if not listed:
if action_types:
gen_expr = (
(m.fmri, a, None, None, None)
for m in manifests
gen_expr = (
(m.fmri, a, None, None, None)
for m in manifests
for a in m.gen_actions()
except StopIteration:
got = None
actionlist = []
if got:
if not text:
if unmatched:
if manifests:
for p in unmatched:
return rval
if not pubs:
return EXIT_OOPS
return rval
elif build_catalog:
elif build_index:
xpub)
return rval
return rval
key = None
cert = None
if pargs:
return EXIT_OK
key = None
cert = None
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
verify_error_header = None
verify_warning_header = None
verify_reason_headers = None
def __load_verify_msgs():
global verify_error_header
global verify_warning_header
global verify_reason_headers
return formatted_message, None
if altroot:
igf))
ignored_dep_files = []
if pargs:
if not repo_uri:
xpub)
return rval
if bad_fmri:
found_pubs = []
if bad_fmris:
return EXIT_OOPS
return EXIT_OK
ignored_dep_files = []
if pargs:
if not repo_uri:
xpub)
return rval
if not verbose:
found_pubs = []
if not fmri:
if verbose:
if broken_fmris:
if failed_fix_paths:
if bad_deps:
return EXIT_OOPS
return EXIT_OK
def main_func():
conf = {}
if DebugValues:
subcommand = None
if pargs:
if show_usage:
elif not subcommand:
if not func:
raise __e
return __ret
except IOError: