Skip to content

Commit

Permalink
dep: update UseDep creation handling for pkgcraft changes
Browse files Browse the repository at this point in the history
  • Loading branch information
radhermit committed Jul 8, 2024
1 parent bfb3cfd commit 1ca440e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
21 changes: 8 additions & 13 deletions src/pkgcraft/C.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ cdef extern from "pkgcraft.h":
SLOT_OPERATOR_EQUAL # = 1,
SLOT_OPERATOR_STAR,

# Package USE dependency type.
cdef enum UseDepKind:
USE_DEP_KIND_ENABLED,
USE_DEP_KIND_EQUAL,
USE_DEP_KIND_CONDITIONAL,

# System config
cdef struct Config:
pass
Expand Down Expand Up @@ -193,22 +199,11 @@ cdef extern from "pkgcraft.h":
cdef struct Version:
pass

# Package USE dependency type.
cdef enum UseDepKind_Tag:
USE_DEP_KIND_ENABLED,
USE_DEP_KIND_EQUAL,
USE_DEP_KIND_CONDITIONAL,

cdef struct UseDepKind:
UseDepKind_Tag tag
bool enabled
bool equal
bool conditional

# C-compatible wrapper for pkgcraft::dep::UseDep.
cdef struct UseDep:
UseDepKind kind
char *flag
UseDepKind kind
bool enabled
bool *default_
UseDepWrapper *dep

Expand Down
4 changes: 2 additions & 2 deletions src/pkgcraft/dep/use_dep.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ cdef class UseDep:
if inst is None:
inst = <UseDep>UseDep.__new__(UseDep)
inst.ptr = <C.UseDep *>ptr
inst.kind = UseDepKind(ptr.kind.tag)
inst.enabled = ptr.kind.enabled
inst.kind = UseDepKind(ptr.kind)
inst.enabled = ptr.enabled
inst.flag = ptr.flag.decode()
if ptr.default_ is NULL:
inst.default_ = None
Expand Down

0 comments on commit 1ca440e

Please sign in to comment.