Skip to content

Commit

Permalink
36591165 clean up packaging and pkgdepend bypasses
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikjak authored and citrus-it committed May 23, 2024
1 parent ec32faa commit aa22cce
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/modules/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def __str__(self):

# This must be imported *after* all of the exception classes are defined as
# _actions module init needs the exception objects.
from ._actions import fromstr
from pkg.actions._actions import fromstr


def attrsfromstr(string):
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
attribute of a package (package metadata). Attributes are typed, and the
possible types are: XXX."""

from . import generic
from pkg.actions import generic
import pkg.fmri
import pkg.actions

Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/depend.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
relationship between the package containing the action and another package.
"""

from . import generic
from pkg.actions import generic
import re

import pkg.actions
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
directory-type packaging object."""

import errno
from . import generic
from pkg.actions import generic
import os
import pkg.portable as portable
import pkg.actions
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"""

import os
from . import generic
from pkg.actions import generic

from tempfile import mkstemp

Expand Down
4 changes: 2 additions & 2 deletions src/modules/actions/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
packaging object."""

import errno
from . import generic
from pkg.actions import generic
import os
import stat
import tempfile
import types
import zlib
import time

from . import _common
from pkg.actions import _common
import pkg.actions
import pkg.client.api_errors as api_errors
import pkg.digest as digest
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import pkg.portable as portable
import pkg.variant as variant

from . import _common
from pkg.actions import _common
from pkg.misc import EmptyDict, CMP_ALL, CMP_UNSIGNED

# Directories must precede all filesystem object actions; hardlinks must follow
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
packaging object. This contains the attributes necessary to create
a new user."""

from . import generic
from pkg.actions import generic

try:
from pkg.cfgfiles import *
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/hardlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
packaging object."""

import errno
from . import generic, link
from pkg.actions import generic, link
import os
import stat

Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import itertools
import time

from . import generic
from pkg.actions import generic
from pkg import misc


Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import os
from stat import S_IWRITE, S_IREAD

from . import generic
from pkg.actions import generic
import pkg.digest as digest
import pkg.misc as misc
import pkg.portable as portable
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import os
import stat

from . import generic
from pkg.actions import generic
import pkg.actions
import pkg.mediator as med

Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding

from . import generic
from pkg.actions import generic
import pkg.actions
import pkg.client.api_errors as apx
import pkg.digest as digest
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/unknown.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
publishing transaction is not given enough information to determine what type of
object it is. No datastreams or attributes aside from a path are stored."""

from . import generic
from pkg.actions import generic


class UnknownAction(generic.Action):
Expand Down
2 changes: 1 addition & 1 deletion src/modules/actions/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
packaging object. This contains the attributes necessary to create
a new user."""

from . import generic
from pkg.actions import generic

try:
from pkg.cfgfiles import *
Expand Down
4 changes: 2 additions & 2 deletions src/modules/client/linkedimage/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#

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

"""
Expand All @@ -34,7 +34,7 @@
import pkg.client.pkgdefs as pkgdefs

# import linked image common code
from . import common as li # Relative import; pylint: disable=W0403
from pkg.client.linkedimage import common as li


class LinkedImageSystemPlugin(li.LinkedImagePlugin):
Expand Down
6 changes: 1 addition & 5 deletions src/modules/client/linkedimage/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
from pkg.client.debugvalues import DebugValues

# import linked image common code
from . import common as li # Relative import; pylint: disable=W0403

# W0511 XXX / FIXME Comments; pylint: disable=W0511
# XXX: should be defined by libzonecfg python wrapper
# pylint: enable=W0511
from pkg.client.linkedimage import common as li

ZONE_GLOBAL = "global"

Expand Down
4 changes: 2 additions & 2 deletions src/modules/portable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def get_sysattr_dict():
PD_BYPASS_GENERATE = "pkg.depend.bypass-generate"

import platform
from . import util as os_util
from pkg.portable import util as os_util

osname = os_util.get_canonical_os_name()
ostype = os_util.get_canonical_os_type()
Expand All @@ -302,7 +302,7 @@ def get_sysattr_dict():
# then try the more generic OS Name module (e.g. os_linux),
# then the OS type module (e.g. os_unix)
try:
exec("from .{0} import *".format(modname))
exec("from pkg.portable.{0} import *".format(modname))
break
except ImportError:
pass
Expand Down
2 changes: 1 addition & 1 deletion src/modules/portable/os_aix.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import os
import errno
from .os_unix import (
from pkg.portable.os_unix import (
get_isainfo,
get_release,
get_platform,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/portable/os_darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
below override the definitions from os_unix
"""

from .os_unix import (
from pkg.portable.os_unix import (
get_isainfo,
get_release,
get_platform,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/portable/os_sunos.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import subprocess
import tempfile

from .os_unix import (
from pkg.portable.os_unix import (
get_group_by_name,
get_user_by_name,
get_name_by_gid,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/portable/os_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import stat
import sys
import tempfile
from . import util as os_util
from pkg.portable import util as os_util

# used to cache contents of passwd and group files
users = {}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/portable/os_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import stat
import tempfile
import threading
from . import util as os_util
from pkg.portable import util as os_util


def get_isainfo():
Expand Down
29 changes: 10 additions & 19 deletions src/pkg/manifests/package:pkg.p5m
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
# Copyright (c) 2012, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
#
#
# pkgdepend doesn't understand the relative import syntax "from .x import y",
# so we have to bypass generating dependencies on those files.
<transform file path=$(PYDIRVP)/pkg/actions -> \
set pkg.depend.bypass-generate .*>
<transform file path=$(PYDIRVP)/pkg/portable -> \
set pkg.depend.bypass-generate .*>
<transform file path=$(PYDIRVP)/pkg/client/linkedimage/(?:system|zone).py -> \
set pkg.depend.bypass-generate .*>
#
# When packaging for aarch64, we need to skip the dependency check on libm.so.0
<transform file path=$(PYDIRVP)/pkg/solver -> \
set pkg.depend.bypass-generate libm.so.0>
Expand Down Expand Up @@ -104,7 +94,7 @@ file path=$(PYDIRVP)/pkg/client/client_api.py
file path=$(PYDIRVP)/pkg/client/debugvalues.py
file path=$(PYDIRVP)/pkg/client/firmware.py
file path=$(PYDIRVP)/pkg/client/history.py
file path=$(PYDIRVP)/pkg/client/image.py pkg.depend.bypass-generate=.*
file path=$(PYDIRVP)/pkg/client/image.py
file path=$(PYDIRVP)/pkg/client/imageconfig.py
file path=$(PYDIRVP)/pkg/client/imageplan.py
file path=$(PYDIRVP)/pkg/client/imagetypes.py
Expand All @@ -122,7 +112,7 @@ file path=$(PYDIRVP)/pkg/client/pkgremote.py
file path=$(PYDIRVP)/pkg/client/plandesc.py
file path=$(PYDIRVP)/pkg/client/printengine.py
file path=$(PYDIRVP)/pkg/client/progress.py
file path=$(PYDIRVP)/pkg/client/publisher.py pkg.depend.bypass-generate=.*
file path=$(PYDIRVP)/pkg/client/publisher.py
file path=$(PYDIRVP)/pkg/client/query_parser.py
file path=$(PYDIRVP)/pkg/client/sigpolicy.py
dir path=$(PYDIRVP)/pkg/client/transport
Expand All @@ -133,8 +123,7 @@ file path=$(PYDIRVP)/pkg/client/transport/fileobj.py
file path=$(PYDIRVP)/pkg/client/transport/mdetect.py
file path=$(PYDIRVP)/pkg/client/transport/repo.py
file path=$(PYDIRVP)/pkg/client/transport/stats.py
file path=$(PYDIRVP)/pkg/client/transport/transport.py \
pkg.depend.bypass-generate=.*
file path=$(PYDIRVP)/pkg/client/transport/transport.py
file path=$(PYDIRVP)/pkg/config.py
file path=$(PYDIRVP)/pkg/cpiofile.py
file path=$(PYDIRVP)/pkg/dependency.py
Expand Down Expand Up @@ -183,10 +172,12 @@ file path=$(PYDIRVP)/pkg/pkgtarfile.py
dir path=$(PYDIRVP)/pkg/portable
file path=$(PYDIRVP)/pkg/portable/__init__.py
file path=$(PYDIRVP)/pkg/portable/os_aix.py
file path=$(PYDIRVP)/pkg/portable/os_darwin.py
file path=$(PYDIRVP)/pkg/portable/os_darwin.py \
pkg.depend.bypass-generate=.*macostools.*
file path=$(PYDIRVP)/pkg/portable/os_sunos.py
file path=$(PYDIRVP)/pkg/portable/os_unix.py
file path=$(PYDIRVP)/pkg/portable/os_windows.py
file path=$(PYDIRVP)/pkg/portable/os_windows.py \
pkg.depend.bypass-generate=.*win32api.*
file path=$(PYDIRVP)/pkg/portable/util.py
file path=$(PYDIRVP)/pkg/pspawn.py
dir path=$(PYDIRVP)/pkg/publish
Expand All @@ -201,11 +192,11 @@ file path=$(PYDIRVP)/pkg/server/__init__.py
file path=$(PYDIRVP)/pkg/server/api.py
file path=$(PYDIRVP)/pkg/server/api_errors.py
file path=$(PYDIRVP)/pkg/server/catalog.py
file path=$(PYDIRVP)/pkg/server/depot.py pkg.depend.bypass-generate=.*
file path=$(PYDIRVP)/pkg/server/depot.py
file path=$(PYDIRVP)/pkg/server/face.py
file path=$(PYDIRVP)/pkg/server/feed.py
file path=$(PYDIRVP)/pkg/server/query_parser.py
file path=$(PYDIRVP)/pkg/server/repository.py pkg.depend.bypass-generate=.*
file path=$(PYDIRVP)/pkg/server/repository.py
file path=$(PYDIRVP)/pkg/server/transaction.py
file path=$(PYDIRVP)/pkg/sha512_t.py
dir path=$(PYDIRVP)/pkg/site_paths
Expand All @@ -215,7 +206,7 @@ file path=$(PYDIRVP)/pkg/solver.cpython$(PYPKGVERS)-$(TRIPLE).so
file path=$(PYDIRVP)/pkg/sysattr.py
file path=$(PYDIRVP)/pkg/syscallat.py
file path=$(PYDIRVP)/pkg/sysvpkg.py
file path=$(PYDIRVP)/pkg/updatelog.py pkg.depend.bypass-generate=.*
file path=$(PYDIRVP)/pkg/updatelog.py
file path=$(PYDIRVP)/pkg/variant.py
file path=$(PYDIRVP)/pkg/version.py
dir path=etc
Expand Down

0 comments on commit aa22cce

Please sign in to comment.