commit:     4992b64a6f726550801e8c56f19b98f209cc9651
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 18:05:35 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 18:05:35 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=4992b64a

atom: add a print helper for debugging

---
 libq/atom_explode.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libq/atom_explode.c b/libq/atom_explode.c
index daa18ac..9eb5695 100644
--- a/libq/atom_explode.c
+++ b/libq/atom_explode.c
@@ -40,6 +40,20 @@ typedef struct {
        char *P, *SLOT, *REPO;
 } depend_atom;
 
+void atom_print(const depend_atom *atom);
+void atom_print(const depend_atom *atom)
+{
+       if (atom->CATEGORY)
+               printf("%s/", atom->CATEGORY);
+       printf("%s", atom->P);
+       if (atom->PR_int)
+               printf("-r%i", atom->PR_int);
+       if (atom->SLOT)
+               printf(":%s", atom->SLOT);
+       if (atom->REPO)
+               printf("::%s", atom->REPO);
+}
+
 #ifdef _USE_CACHE
 static depend_atom *_atom_cache = NULL;
 static size_t _atom_cache_len = 0;

Reply via email to