File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ):
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments