commit:     2a25ec6e1470446e80f12d2c51118c35e57024b3
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 18:22:39 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 18:22:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2a25ec6e

tests/atom_explode: deal with Manifest.gz files, bug #638970

There is two parts in here:
a) atom-explode.py: don't crash when Portage couldn't map an atom, just
   print a descriptive message instead
b) dotest: filter out Manifest.* files to not feed in non-atoms

thanks tka for testing

Bug: https://bugs.gentoo.org/638970

 tests/atom_explode/atom-explode.py | 3 +++
 tests/atom_explode/dotest          | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/atom_explode/atom-explode.py 
b/tests/atom_explode/atom-explode.py
index d28aaed..972bac7 100755
--- a/tests/atom_explode/atom-explode.py
+++ b/tests/atom_explode/atom-explode.py
@@ -5,6 +5,9 @@ import sys,portage
 def doit(a):
        # ['x11-terms', 'wterm', '6.2.9', 'r2']
        cpv = portage.catpkgsplit(a)
+       if not cpv:
+               print("Portage could not match " + a + " to a package")
+               return
        # input -> CATEGORY / [P] PN - PVR [PV] [PR_int]
        CATEGORY = cpv[0]
        PN = cpv[1]

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index e852bc0..3fe7086 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -14,7 +14,7 @@ if [[ $1 == -v ]] ; then
 fi
 
 # split the disk i/o out so both tests are CPU bound only
-files=$(find . -mindepth 2 -type f -printf '%P\n%f\n')
+files=$(find . -mindepth 2 -type f ! -name "Manifest.*" -printf '%P\n%f\n')
 popd >/dev/null
 
 printf "atom_explode():"

Reply via email to