Skip to content

Commit

Permalink
Merge pull request #468 from citrus-it/merge
Browse files Browse the repository at this point in the history
Import upstream changes
  • Loading branch information
oetiker authored Feb 12, 2024
2 parents 4a5b6ff + 0d84534 commit 7c696c3
Show file tree
Hide file tree
Showing 135 changed files with 1,746 additions and 1,934 deletions.
7 changes: 3 additions & 4 deletions README.sync
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
The pkg5 components have been updated to the latest upstream solaris-ips
as of:

commit fc93022c19a68dae3db7613ff1860e6371fe85bc
commit aabf00838e04ed9a266354e598b408dd245773b3
Author: Jakub Kulik <[email protected]>
Date: Tue Dec 5 00:40:48 2023 -0800
Date: Mon Feb 5 06:41:13 2024 -0800

36066495 remove all trivial use of six library from pkg(7) and related
tools
36255456 fix most 'statement' pycodestyle issues

-----------------------------------------------------------------------------

3 changes: 1 addition & 2 deletions src/cffi_src/build_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#

#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, Oracle and/or its affiliates.
#

from __future__ import unicode_literals
from cffi import FFI

ffi = FFI()
Expand Down
3 changes: 1 addition & 2 deletions src/cffi_src/build_pspawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#

#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, Oracle and/or its affiliates.
#

from __future__ import unicode_literals
from cffi import FFI

ffi = FFI()
Expand Down
3 changes: 1 addition & 2 deletions src/cffi_src/build_sha512_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
#

#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
# Copyright (c) 2015, 2024, Oracle and/or its affiliates.
#

from __future__ import unicode_literals
from cffi import FFI

ffi = FFI()
Expand Down
3 changes: 1 addition & 2 deletions src/cffi_src/build_sysattr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#

#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, Oracle and/or its affiliates.
#

from __future__ import unicode_literals
from cffi import FFI

ffi = FFI()
Expand Down
3 changes: 1 addition & 2 deletions src/cffi_src/build_syscallat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#

#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, Oracle and/or its affiliates.
#

from __future__ import unicode_literals
from cffi import FFI

ffi = FFI()
Expand Down
39 changes: 20 additions & 19 deletions src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#

#
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
# Copyright (c) 2007, 2022, Oracle and/or its affiliates.
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
# Copyright (c) 2007, 2024, Oracle and/or its affiliates.
#

#
Expand Down Expand Up @@ -129,7 +129,7 @@
except KeyboardInterrupt:
import sys

sys.exit(1)
sys.exit(1) # EXIT_OOPS

CLIENT_API_VERSION = 83
PKG_CLIENT_NAME = "pkg"
Expand Down Expand Up @@ -724,7 +724,7 @@ def gen(meta=False):
yield {k: fields[k].get("header") for k in fields.keys()}
return

if not "data" in out_json:
if "data" not in out_json:
return
data = out_json["data"]

Expand Down Expand Up @@ -1049,9 +1049,11 @@ def cond_show(s1, s2, v):
status.append(
(
_("Activate boot environment:"),
"Next boot only"
if plan.activate_be == "bootnext"
else bool_str(plan.activate_be),
(
"Next boot only"
if plan.activate_be == "bootnext"
else bool_str(plan.activate_be)
),
)
)
# plan.be_name can be undefined in the uninstall case
Expand Down Expand Up @@ -2203,7 +2205,7 @@ def __api_plan(

# display plan debugging information
if _verbose > 2:
DebugValues.set_value("plan", "True")
DebugValues["plan"] = "True"

# plan the requested operation
stuff_to_do = None
Expand Down Expand Up @@ -3841,7 +3843,7 @@ def set_mediator(
)

if verbose > 2:
DebugValues.set_value("plan", "True")
DebugValues["plan"] = "True"

# Now set version and/or implementation for all matching mediators.
# The user may specify 'None' as a special value to explicitly
Expand Down Expand Up @@ -3951,7 +3953,7 @@ def unset_mediator(
if not pargs:
usage(_("at least one mediator must be specified"), cmd=op)
if verbose > 2:
DebugValues.set_value("plan", "True")
DebugValues["plan"] = "True"

# Build dictionary of mediators to unset based on input.
mediators = collections.defaultdict(dict)
Expand Down Expand Up @@ -7555,7 +7557,7 @@ def main_func():
"name=value, not {arg}"
).format(opt=opt, arg=arg)
)
DebugValues.set_value(key, value)
DebugValues[key] = value
elif opt == "-R":
mydir = arg
elif opt == "--runid":
Expand Down Expand Up @@ -7939,7 +7941,7 @@ def _wrapper():

__ret = handle_errors(_wrapper, non_wrap_print=False)
s = ""
if __ret == 99:
if __ret == EXIT_FATAL:
s += _("\n{err}{stacktrace}").format(
err=__e, stacktrace=traceback_str
)
Expand Down Expand Up @@ -7967,13 +7969,13 @@ def _wrapper():
" a UTF-8 locale or C."
)
__ret = EXIT_OOPS
except:
except Exception:
if _api_inst:
_api_inst.abort(result=RESULT_FAILED_UNKNOWN)
if non_wrap_print:
traceback.print_exc()
error(traceback_str)
__ret = 99
__ret = EXIT_FATAL
return __ret


Expand All @@ -7999,12 +8001,11 @@ def handle_sighupterm(signum, frame):
gettext.install("pkg", "/usr/share/locale")
misc.set_fd_limits(printer=error)

# Make all warnings be errors.
import warnings
# By default, hide all warnings from users.
if not sys.warnoptions:
import warnings

warnings.simplefilter("error")
# disable ResourceWarning: unclosed file
warnings.filterwarnings("ignore", category=ResourceWarning)
warnings.simplefilter("ignore")

# Attempt to handle SIGHUP/SIGTERM gracefully.
import signal
Expand Down
Loading

0 comments on commit 7c696c3

Please sign in to comment.