aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-29 12:09:09 +0200
committerStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-29 12:55:21 +0200
commit06299cc84a51339150d24e3a9cef30c7558ef929 (patch)
treedf19faf590a19704b8759daa5aef8f3400e8a8cd
parentTesting for more packages in create_dep_groups (diff)
downloadcollagen-06299cc84a51339150d24e3a9cef30c7558ef929.tar.gz
collagen-06299cc84a51339150d24e3a9cef30c7558ef929.tar.bz2
collagen-06299cc84a51339150d24e3a9cef30c7558ef929.zip
Modified logging to trace more things
mainly outside chroot so modifications were to init_logging so we are able to chose logging dir
-rw-r--r--src/tinderbox/__init__.py10
-rw-r--r--src/tinderbox/logger.py6
2 files changed, 12 insertions, 4 deletions
diff --git a/src/tinderbox/__init__.py b/src/tinderbox/__init__.py
index 87fb515..66fe821 100644
--- a/src/tinderbox/__init__.py
+++ b/src/tinderbox/__init__.py
@@ -34,6 +34,7 @@ class Tinderbox(object):
self.settings["PORTAGE_VERBOSE"]="1"
self.settings.backup_changes("PORTAGE_VERBOSE")
self.setconf = psets.SetConfig(None, self.settings, self.trees)
+ init_logging('/tmp')
def start_tinderbox(self):
@@ -62,6 +63,7 @@ class Tinderbox(object):
def emerge_package(self, package):
+ log.debug("emerge_package starting for %s" % package.name)
settings = self.settings
porttree = self.trees[portage.root]['porttree']
@@ -89,6 +91,7 @@ class Tinderbox(object):
use_deps = flatten_deps(use_deps)
+ log.debug("calling create_dep_groups for pkg %s use_deps %s" % (pkg, use_deps))
dep_groups = self.create_dep_groups(use_deps)
# prepare chroot & fork & do work
@@ -111,7 +114,7 @@ class Tinderbox(object):
# setup logging!
os.chroot(config.WORK_CHROOT)
os.chdir("/")
- init_logging()
+ init_logging(config.CHROOT_LOGS)
pkgname, pkgver, pkgrev = portage.pkgsplit(pkg)
if pkgrev is "r0":
@@ -326,6 +329,7 @@ class Tinderbox(object):
['=virtual/jdk-1.5*', 'app-arch/unzip']
>>>
"""
+ log.debug("normalize_dependencies called with deps: %s" % deps)
new_deps = []
for i in range(len(deps)):
if deps[i] == '||':
@@ -355,6 +359,7 @@ class Tinderbox(object):
[(None,'net-fs/samba-3.0.32'),(None, 'dev-libs/glib-2.18.4-r1'),(None, 'x11-libs/libX11-1.1.3-r1'), (['-dso'],'dev-util/subversion-1.5.5'],
[(None,'net-fs/samba-3.0.32'),(None, 'dev-libs/glib-2.20.3'),(None, 'x11-libs/libX11-1.1.3'), (['-dso'],'dev-util/subversion-1.5.5'],
"""
+ log.debug("create_dep_groups called with deps %s" % deps)
result = None
porttree = self.trees[portage.root]['porttree']
portdb = porttree.dbapi
@@ -366,6 +371,9 @@ class Tinderbox(object):
dep_useflag = list(portage.dep.dep_getusedeps(dep))
if 0 == len(dep_useflag):
dep_useflag = None
+ if not portage.dep.isvalidatom(dep):
+ log.error("%s is not valid atom in %s" % (dep, str(deps)))
+ continue
depversions = portdb.xmatch('match-all',dep)
depversions = [(dep_useflag,x) for x in depversions]
deps_expanded.append(depversions)
diff --git a/src/tinderbox/logger.py b/src/tinderbox/logger.py
index 59b1609..d73b7f3 100644
--- a/src/tinderbox/logger.py
+++ b/src/tinderbox/logger.py
@@ -3,14 +3,14 @@ from errno import *
import logging as log
import config
-def init_logging():
+def init_logging(dir):
"""Initialize logging file and settings
"""
try:
- os.mkdir(config.CHROOT_LOGS)
+ os.mkdir(dir)
except OSError, e:
if e.errno != EEXIST:
raise e
log.basicConfig(level=config.LOG_LEVEL, format='%(asctime)s %(levelname)s %(message)s',
- filename=config.CHROOT_LOGS+'/tinderbox.log', filemode='w')
+ filename=dir+'/tinderbox.log', filemode='a')