summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dep.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index cf06eca7f..c16b816b6 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -918,28 +918,23 @@ def isvalidatom(atom, allow_blockers=False):
def isjustname(mypkg):
"""
- Checks to see if the depstring is only the package name (no version parts)
+ Checks to see if the atom is only the package name (no version parts).
+ Raises InvalidAtom if the input is invalid.
Example usage:
>>> isjustname('media-libs/test-3.0')
- 0
- >>> isjustname('test')
- 1
+ False
>>> isjustname('media-libs/test')
- 1
+ True
@param mypkg: The package atom to check
- @param mypkg: String
+ @param mypkg: String or Atom
@rtype: Integer
@return: One of the following:
- 1) 0 if the package string is not just the package name
- 2) 1 if it is
+ 1) False if the package string is not just the package name
+ 2) True if it is
"""
- myparts = mypkg.split('-')
- for x in myparts:
- if ververify(x):
- return 0
- return 1
+ return str(mypkg) == str(Atom(mypkg).cp)
iscache = {}