Skip to content

Commit 03df7d3

Browse files
committed
pkg: add deprecated and masked properties for ebuild pkgs
1 parent 7a0c881 commit 03df7d3

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/pkgcraft/C.pxd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,12 @@ cdef extern from "pkgcraft.h":
13831383
# The argument must be a non-null Pkg pointer.
13841384
DependencySet *pkgcraft_pkg_ebuild_dependencies(Pkg *p, char **keys, uintptr_t len)
13851385

1386+
# Return a package's deprecated status.
1387+
#
1388+
# # Safety
1389+
# The argument must be a non-null Pkg pointer.
1390+
bool pkgcraft_pkg_ebuild_deprecated(Pkg *p)
1391+
13861392
# Return a package's description.
13871393
#
13881394
# # Safety
@@ -1466,6 +1472,12 @@ cdef extern from "pkgcraft.h":
14661472
# with the length of the array.
14671473
void pkgcraft_pkg_ebuild_maintainers_free(Maintainer **maintainers, uintptr_t len)
14681474

1475+
# Return a package's masked status.
1476+
#
1477+
# # Safety
1478+
# The argument must be a non-null Pkg pointer.
1479+
bool pkgcraft_pkg_ebuild_masked(Pkg *p)
1480+
14691481
# Return a package's path.
14701482
#
14711483
# # Safety

src/pkgcraft/pkg/ebuild.pyx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ cdef class EbuildPkg(Pkg):
3131
return cstring_to_str(ptr)
3232
raise PkgcraftError
3333

34+
@property
35+
def deprecated(self):
36+
"""Get a package's deprecated status."""
37+
return C.pkgcraft_pkg_ebuild_deprecated(self.ptr)
38+
39+
@property
40+
def masked(self):
41+
"""Get a package's masked status."""
42+
return C.pkgcraft_pkg_ebuild_masked(self.ptr)
43+
3444
@property
3545
def description(self):
3646
"""Get a package's description."""

0 commit comments

Comments
 (0)