summaryrefslogtreecommitdiffstats
path: root/src/software/test/rpmcache.py
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2012-12-11 12:39:04 +0100
committerMichal Minar <miminar@redhat.com>2012-12-11 12:39:04 +0100
commit51d608eb5db9d977750709fb9ad4a0fad2be6c02 (patch)
treec6f4c16802b7c91d37ba12d12f03ac36664f9dde /src/software/test/rpmcache.py
parenteec47d84365df5576738ad83e67599cfa08d3b5b (diff)
downloadopenlmi-providers-51d608eb5db9d977750709fb9ad4a0fad2be6c02.tar.gz
openlmi-providers-51d608eb5db9d977750709fb9ad4a0fad2be6c02.tar.xz
openlmi-providers-51d608eb5db9d977750709fb9ad4a0fad2be6c02.zip
more software test bugfixes
* handle '*' in yum repolist * select pkg database from 5 times required number of packages
Diffstat (limited to 'src/software/test/rpmcache.py')
-rw-r--r--src/software/test/rpmcache.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/software/test/rpmcache.py b/src/software/test/rpmcache.py
index af0d47c..af64fe3 100644
--- a/src/software/test/rpmcache.py
+++ b/src/software/test/rpmcache.py
@@ -146,7 +146,7 @@ RE_PKG_INFO = re.compile(
r'^Size\s*:\s*(?P<size>\d+(\.\d+)?)( *(?P<units>[kMG]))?',
re.MULTILINE | re.DOTALL | re.IGNORECASE)
RE_REPO = re.compile(
- r'^[^\s/]+\b(?!\s+id)', re.MULTILINE | re.IGNORECASE)
+ r'(?:^\*?)(?P<name>[^\s/]+\b)(?!\s+id)', re.MULTILINE | re.IGNORECASE)
# maximum number of packages, that will be selected for testing
MAX_PKG_DB_SIZE = 3
@@ -216,6 +216,7 @@ def _check_pkg_dependencies(
dups_no_deps = []
for i in range(0, len(dup_list), PKG_DEPS_ITER_STEP):
dups_part = dup_list[i:i+PKG_DEPS_ITER_STEP]
+ cmd = cmd[:2]
for dups in dups_part:
cmd.append(dups[0].name)
deplist_str = check_output(cmd)
@@ -390,7 +391,8 @@ def get_pkg_database(force_update=False, use_cache=True, cache_dir=''):
dups_list = _filter_duplicates(installed, avail_str)
#print "Selecting only those (from %d) with installed dependencies" % \
#len(dups_list)
- selected = _check_pkg_dependencies(installed, dups_list)
+ selected = _check_pkg_dependencies(installed, dups_list,
+ number_of_packages=MAX_PKG_DB_SIZE*5)
#print "Selecting the smallest ones"
pkgdb = _sorted_db_by_size(selected)
if use_cache: