Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sync #463

Merged
merged 15 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.sync
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
The pkg5 components have been updated to the latest upstream solaris-ips
as of:

commit c5674fc26b31cd234007b090c451aa4ea0e0a668
commit fc93022c19a68dae3db7613ff1860e6371fe85bc
Author: Jakub Kulik <[email protected]>
Date: Fri Oct 20 06:43:37 2023 -0700
Date: Tue Dec 5 00:40:48 2023 -0800

34044891 pkg verify is outputting ELF error that makes no sense
36066495 remove all trivial use of six library from pkg(7) and related
tools

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

4 changes: 4 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ packages: install

test: install .WAIT $(PYTESTS) $(TESTRESULTS)

fmt: FRC
python$(PYVER) -mpip install --quiet --user --upgrade black
$(HOME)/.local/bin/black --config $(CODE_WS)/.black $(CODE_WS)/src

$(SUBDIRS) cffi_src: FRC
@cd $@; pwd; $(MAKE) $(TARGET) CC=$(CC)

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.com
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ROOTUSRLIB = $(ROOT)/usr/lib
ROOTBRAND = $(ROOTUSRLIB)/brand
ROOTPKGLIB = $(ROOTUSRLIB)/pkg

CC = /usr/bin/gcc-12
CC = /usr/bin/gcc-13
CFLAGS = -m64 -Wall -Werror -Wextra -gdwarf-2 -gstrict-dwarf \
-fno-aggressive-loop-optimizations
CPPFLAGS = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
Expand Down
4 changes: 2 additions & 2 deletions src/brand/bhyve/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file was automatically produced by tools/updatereqs
# Generated on Fri Nov 10 13:47:42 UTC 2023
# Generated on Tue Dec 5 14:13:54 UTC 2023
# Do not edit directly
#
construct==2.10.69
construct==2.10.70
PyYAML==6.0.1
1 change: 0 additions & 1 deletion src/brand/ipkg/fmri_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# Use is subject to license terms.
#

from __future__ import print_function
import pkg.fmri
import sys

Expand Down
36 changes: 16 additions & 20 deletions src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import logging
import os
import re
import six
import socket
import sys
import tempfile
Expand All @@ -84,7 +83,7 @@
import pycurl
import atexit
import shutil
from six.moves.urllib.parse import urlparse, unquote
from urllib.parse import urlparse, unquote

import pkg
import pkg.actions as actions
Expand Down Expand Up @@ -151,7 +150,7 @@
all_formats = ("default", "json", "tsv")

default_attrs = {}
for atype, aclass in six.iteritems(actions.types):
for atype, aclass in actions.types.items():
default_attrs[atype] = [aclass.key_attr]
if atype == "depend":
default_attrs[atype].insert(0, "type")
Expand Down Expand Up @@ -204,7 +203,7 @@ def format_update_error(e):
def error(text, cmd=None):
"""Emit an error message prefixed by the command name"""

if not isinstance(text, six.string_types):
if not isinstance(text, str):
# Assume it's an object that can be stringified.
text = str(text)

Expand Down Expand Up @@ -1085,9 +1084,11 @@ def cond_show(s1, s2, v):
if not verbose and r and op in [PKG_OP_INSTALL, PKG_OP_UPDATE]:
logger.info(_("\nRemoved Packages:\n"))
removals = [src.pkg_stem for src, dest in r]
if len(r) <= 5:
if len(r) <= 7:
logger.info(" " + "\n ".join(removals))
else:
# Display 7 lines at maximum, which is the first 5 removed
# packages and two additional lines below.
logger.info(" " + "\n ".join(removals[:5]))
logger.info(" ...")
logger.info(
Expand Down Expand Up @@ -1996,10 +1997,7 @@ def __api_execute_plan(operation, api_inst):
raise

if exc_value or exc_tb:
if six.PY2:
six.reraise(exc_value, None, exc_tb)
else:
raise exc_value
raise exc_value

return rval

Expand Down Expand Up @@ -3696,7 +3694,7 @@ def list_mediators(
# Configured mediator information
gen_mediators = (
(mediator, mediation)
for mediator, mediation in six.iteritems(api_inst.mediators)
for mediator, mediation in api_inst.mediators.items()
)

# Set minimum widths for mediator and version columns by using the
Expand Down Expand Up @@ -4048,16 +4046,15 @@ def unavoid(api_inst, args):
def __display_avoids(api_inst):
"""Display the current avoid list, and the pkgs that are tracking
that pkg"""
for a in api_inst.get_avoid_list():
tracking = " ".join(a[1])
for avoid, tracking in sorted(api_inst.get_avoid_list()):
if tracking:
logger.info(
_(
" {avoid_pkg} (group dependency of " "'{tracking_pkg}')"
).format(avoid_pkg=a[0], tracking_pkg=tracking)
" {avoid_pkg} (group dependency of '{tracking_pkg}')"
).format(avoid_pkg=avoid, tracking_pkg=" ".join(tracking))
)
else:
logger.info(" {0}".format(a[0]))
logger.info(" {0}".format(avoid))

return EXIT_OK

Expand Down Expand Up @@ -5676,7 +5673,7 @@ def display_ssl_info(uri_data):

if "Properties" not in pub:
continue
pub_items = sorted(six.iteritems(pub["Properties"]))
pub_items = sorted(pub["Properties"].items())
property_padding = " "
properties_displayed = False
for k, v in pub_items:
Expand All @@ -5685,7 +5682,7 @@ def display_ssl_info(uri_data):
if not properties_displayed:
msg(_(" Properties:"))
properties_displayed = True
if not isinstance(v, six.string_types):
if not isinstance(v, str):
v = ", ".join(sorted(v))
msg(property_padding, k + " =", str(v))
return retcode
Expand Down Expand Up @@ -8006,9 +8003,8 @@ def handle_sighupterm(signum, frame):
import warnings

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

# Attempt to handle SIGHUP/SIGTERM gracefully.
import signal
Expand Down
6 changes: 2 additions & 4 deletions src/depot-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import os
import re
import shutil
import six
import socket
import sys
import traceback
Expand Down Expand Up @@ -1182,9 +1181,8 @@ def handle_errors(func, *args, **kwargs):

# Make all warnings be errors.
warnings.simplefilter("error")
if six.PY3:
# disable ResourceWarning: unclosed file
warnings.filterwarnings("ignore", category=ResourceWarning)
# disable ResourceWarning: unclosed file
warnings.filterwarnings("ignore", category=ResourceWarning)

__retval = handle_errors(main_func)
try:
Expand Down
9 changes: 2 additions & 7 deletions src/depot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# Copyright (c) 2007, 2022, Oracle and/or its affiliates.
#

from __future__ import print_function
import pkg.site_paths

pkg.site_paths.init()
Expand Down Expand Up @@ -75,15 +74,14 @@
import OpenSSL.crypto as crypto
import string
import shlex
import six
import string
import subprocess
import sys
import tempfile
import portend

from importlib import reload
from six.moves.urllib.parse import urlparse, urlunparse
from urllib.parse import urlparse, urlunparse

try:
import cherrypy
Expand Down Expand Up @@ -119,10 +117,7 @@
# to let the dispatcher to find the correct page handler, we need to skip
# converting the hyphen symbol.
punc = string.punctuation.replace("-", "_")
if six.PY2:
translate = string.maketrans(punc, "_" * len(string.punctuation))
else:
translate = str.maketrans(punc, "_" * len(string.punctuation))
translate = str.maketrans(punc, "_" * len(string.punctuation))


class Pkg5Dispatcher(Dispatcher):
Expand Down
Loading