Skip to content

Commit

Permalink
Merge pull request #492 from citrus-it/sync
Browse files Browse the repository at this point in the history
Upstream IPS sync
  • Loading branch information
hadfl authored Aug 24, 2024
2 parents d828d9b + abd4076 commit a23e6f1
Show file tree
Hide file tree
Showing 35 changed files with 973 additions and 851 deletions.
6 changes: 3 additions & 3 deletions README.sync
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
The pkg5 components have been updated to the latest upstream solaris-ips
as of:

commit 2cb20af7cc68247c0a809de5378915a99d2bc17b
commit 7caddba490ac61d0ae1ad9daead93e1fc7265c9c
Author: Jakub Kulik <[email protected]>
Date: Thu Jun 20 04:41:22 2024 -0700
Date: Wed Aug 14 06:40:52 2024 -0700

36752252 fix several real errors reported by pylint
29414815 -D firmware-dependency-bypass=1 option throws stacktrace

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

1 change: 1 addition & 0 deletions exception_lists/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ doc/*
src/tests/*.txt
src/po/LINGUAS
src/po/POTFILES.*
src/pkg/license_files/lic_*
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ clobber := TARGET = clobber
check := TARGET = check
packages := TARGET = install

SUBDIRS=brand util/mkcert man po
SUBDIRS=brand util/mkcert man po svc web

all: $(SUBDIRS)

Expand Down
2 changes: 1 addition & 1 deletion src/cffi_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
#

EXTENSIONS= arch pspawn sha512_t sysattr syscallat
EXTENSIONS= arch sha512_t sysattr syscallat
SOURCES= $(EXTENSIONS:%=_%.c)
OUTDIR= cffi_src

Expand Down
90 changes: 0 additions & 90 deletions src/cffi_src/build_pspawn.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/modules/actions/depend.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def astr(aout):
for k, v in sorted(act.attrs.items(), key=key_func):
# Newline breaks are only forced when there is
# more than one value for an attribute.
if not (isinstance(v, list) or isinstance(v, set)):
if not isinstance(v, (list, set)):
nv = [v]
use_force_nl = False
else:
Expand Down
7 changes: 1 addition & 6 deletions src/modules/client/api_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3885,12 +3885,7 @@ class InvalidOptionErrors(ApiException):
def __init__(self, errors):
self.errors = []

assert (
isinstance(errors, list)
or isinstance(errors, tuple)
or isinstance(errors, set)
or isinstance(errors, InvalidOptionError)
)
assert isinstance(errors, (list, tuple, set, InvalidOptionError))

if isinstance(errors, InvalidOptionError):
self.errors.append(errors)
Expand Down
10 changes: 8 additions & 2 deletions src/modules/client/client_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,14 +1720,20 @@ def __api_op(
# consumer from creating a noop plan and then
# preparing and executing it.)
__api_plan_save(_api_inst, logger=logger)
# for pkg verify or fix.
# The branch for fix and verify has to be handled first, to
# return the exit code from the run instead of the generic
# EXIT_NOP. When there is nothing to do we consider this a
# success for verification.
if _op in [PKG_OP_FIX, PKG_OP_VERIFY] and _noexecute and _quiet_plan:
exit_code = __verify_exit_status(_api_inst)
return __prepare_json(exit_code, data=data)
if _api_inst.planned_nothingtodo():
return __prepare_json(EXIT_NOP, data=data)
if _noexecute or _stage == API_STAGE_PLAN:
if _stage == API_STAGE_PLAN:
return __prepare_json(EXIT_OK, data=data)
if _noexecute:
exit_code = __verify_exit_status(_api_inst)
return __prepare_json(exit_code, data=data)
else:
assert _stage in [API_STAGE_PREPARE, API_STAGE_EXECUTE]
__api_plan_load(_api_inst, _stage, _origins, logger=logger)
Expand Down
6 changes: 2 additions & 4 deletions src/modules/client/imageplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4172,9 +4172,7 @@ def __evaluate_pkg_downloads(self):
_("Root filesystem"),
)
timestamp = misc.time_to_timestamp(time.time())
self.pd.add_item_message(
"warning", timestamp, MSG_WARNING, _(msg)
)
self.pd.add_item_message("errors", timestamp, MSG_ERROR, _(msg))
else:
raise api_errors.ImageInsufficentSpace(
self.pd._bytes_added,
Expand Down Expand Up @@ -4238,7 +4236,7 @@ def evaluate(self):
medmsg = self.__make_med_msg()
timestamp = misc.time_to_timestamp(time.time())
self.pd.add_item_message(
"warning", timestamp, MSG_WARNING, medmsg
"warnings", timestamp, MSG_WARNING, medmsg
)

def __update_avail_space(self):
Expand Down
3 changes: 2 additions & 1 deletion src/modules/client/linkedimage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,8 @@ def __child_op_finish(

# keep going as long as there are children to process
progtrack_update = False
while len(lic_setup) or len(lic_running):
while lic_setup or lic_running:

while lic_setup and (
concurrency > len(lic_running) or concurrency <= 0
):
Expand Down
14 changes: 7 additions & 7 deletions src/modules/client/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,11 +1569,11 @@ def actions_all_done(self):
def job_start(self, jobid, goal=None):
jobitem = self._jobitems[jobid]
jobitem.reset()
outspec = OutSpec()
if goal:
if not isinstance(jobitem, GoalTrackerItem):
raise RuntimeError("can't set goal on non-goal tracker")
jobitem.goalitems = goal
outspec = OutSpec(first=True)
jobitem.printed = True
self._job_output(outspec, jobitem)

Expand Down Expand Up @@ -2187,7 +2187,7 @@ def _republish_output(self, outspec):
if "startpkg" in outspec.changed:
pkgfmri = self.repub_pkgs.curinfo
self.__generic_start(
_("Republish: {0} ... ").format(pkgfmri.get_fmri(anarchy=True))
_("Republish: {0} ...").format(pkgfmri.get_fmri(anarchy=True))
)
if "endpkg" in outspec.changed:
self.__generic_done()
Expand Down Expand Up @@ -2259,14 +2259,14 @@ def _act_output_all_done(self):

def _job_output(self, outspec, jobitem):
if outspec.first:
self.__generic_start("{0} ... ".format(jobitem.name))
self.__generic_start("{0} ...".format(jobitem.name))
if outspec.last:
self.__generic_done_item(jobitem)

def _lint_output(self, outspec):
if outspec.first:
if self.lint_phasetype == self.LINT_PHASETYPE_SETUP:
self._pe.cprint("{0} ... ".format(self.lintitems.name), end="")
self._pe.cprint("{0} ...".format(self.lintitems.name), end="")
elif self.lint_phasetype == self.LINT_PHASETYPE_EXECUTE:
self._pe.cprint("# --- {0} ---".format(self.lintitems.name))
if outspec.last:
Expand Down Expand Up @@ -2602,7 +2602,7 @@ def _republish_output(self, outspec):
if "startpkg" in outspec.changed:
pkgfmri = self.repub_pkgs.curinfo
self.__generic_start(
_("Republish: {0} ... ").format(pkgfmri.get_fmri(anarchy=True))
_("Republish: {0} ...").format(pkgfmri.get_fmri(anarchy=True))
)
if "endpkg" in outspec.changed:
self.__generic_done()
Expand Down Expand Up @@ -2677,14 +2677,14 @@ def _act_output_all_done(self):

def _job_output(self, outspec, jobitem):
if outspec.first:
self.__generic_start("{0} ... ".format(jobitem.name))
self.__generic_start("{0} ...".format(jobitem.name))
if outspec.last:
self.__generic_done_item(jobitem)

def _lint_output(self, outspec):
if outspec.first:
if self.lint_phasetype == self.LINT_PHASETYPE_SETUP:
msg = "{0} ... ".format(self.lintitems.name)
msg = "{0} ...".format(self.lintitems.name)
prog_json = {self.O_PHASE: _("Setup"), self.O_MESSAGE: msg}
self.__handle_prog_output(prog_json)
elif self.lint_phasetype == self.LINT_PHASETYPE_EXECUTE:
Expand Down
2 changes: 1 addition & 1 deletion src/modules/client/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def __set_proxies(self, proxies):
"proxies", scheme=self.scheme
)

if not (isinstance(proxies, list) or isinstance(proxies, tuple)):
if not isinstance(proxies, (list, tuple)):
raise api_errors.BadRepositoryAttributeValue(
"proxies", value=proxies
)
Expand Down
8 changes: 3 additions & 5 deletions src/modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def value(self, value):
self._is_allowed(v)
nvalue.append(v)

if self.allowed and "" not in self.allowed and not len(nvalue):
if self.allowed and "" not in self.allowed and not nvalue:
raise InvalidPropertyValueError(prop=self.name, value=nvalue)

self._value = nvalue
Expand Down Expand Up @@ -645,7 +645,7 @@ def value(self, value):
nvalue.append(v)

# if we don't allow an empty list, raise an error
if self.allowed and "" not in self.allowed and not len(nvalue):
if self.allowed and "" not in self.allowed and not nvalue:
raise InvalidPropertyValueError(prop=self.name, value=nvalue)
self._value = nvalue

Expand Down Expand Up @@ -728,9 +728,7 @@ def _parse_str(self, value):
return result

def __str__(self):
if self.value and len(self.value):
# Performing the join using a unicode string results in
# a single unicode string object.
if self.value:
return ",".join(self.value)
return ""

Expand Down
15 changes: 10 additions & 5 deletions src/modules/flavor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
#

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

__all__ = ["base" "elf" "hardlink" "pound_bang" "python" "smf_manifest"]

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
__all__ = [
"base",
"depthlimitedmf",
"elf",
"hardlink",
"python",
"script",
"smf_manifest",
]
Loading

0 comments on commit a23e6f1

Please sign in to comment.