Skip to content

Commit 5649799

Browse files
committed
atom: pull revision from version object
1 parent 0027f21 commit 5649799

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/pkgcraft/atom/base.pyx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@ cdef class Cpv:
104104
>>> a.revision
105105
'0'
106106
"""
107-
c_str = C.pkgcraft_atom_revision(self.ptr)
108-
if c_str is not NULL:
109-
s = c_str.decode()
110-
C.pkgcraft_str_free(c_str)
111-
return s
107+
version = self.version
108+
if version is not None:
109+
return version.revision
112110
return None
113111

114112
@property
@@ -342,7 +340,7 @@ cdef class Atom(Cpv):
342340
version = self.version
343341
if version is not None:
344342
return version.op
345-
return version
343+
return None
346344

347345
@property
348346
def slot(self):

src/pkgcraft/pkgcraft_c.pxd

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,6 @@ cdef extern from "pkgcraft.h":
238238
# The arguments must be valid Restrict and Atom pointers.
239239
bool pkgcraft_atom_restrict_matches(Atom *atom, Restrict *r)
240240

241-
# Return an atom's revision, e.g. the atom "=cat/pkg-1-r2" has a revision of "2".
242-
#
243-
# Returns NULL on nonexistence.
244-
#
245-
# # Safety
246-
# The argument must be a non-null Atom pointer.
247-
char *pkgcraft_atom_revision(Atom *atom)
248-
249241
# Return an atom's slot, e.g. the atom "=cat/pkg-1-r2:3" has a slot of "3".
250242
#
251243
# Returns NULL on nonexistence.

0 commit comments

Comments
 (0)