aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-06 21:05:51 +0200
committerStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-06 21:05:51 +0200
commitf28579e9455875198eaa2f2bb23a003f417b3bd3 (patch)
tree210cb198524ea71ebc01c1ee9e74b4fe54193824 /src
parentChanged umount command (diff)
downloadcollagen-f28579e9455875198eaa2f2bb23a003f417b3bd3.tar.gz
collagen-f28579e9455875198eaa2f2bb23a003f417b3bd3.tar.bz2
collagen-f28579e9455875198eaa2f2bb23a003f417b3bd3.zip
Changed order of comparisons in 'ifs'
to make things more fool-proof, if = is mistaken for == syntax error would ensue...
Diffstat (limited to 'src')
-rw-r--r--src/tinderbox/__init__.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tinderbox/__init__.py b/src/tinderbox/__init__.py
index eeaad2e..6aea7c1 100644
--- a/src/tinderbox/__init__.py
+++ b/src/tinderbox/__init__.py
@@ -105,7 +105,7 @@ class Tinderbox(object):
self.child_pid = os.fork()
childpid = self.child_pid
- if childpid == 0:
+ if 0 == childpid:
# we are the child!
try:
# setup logging!
@@ -123,7 +123,7 @@ class Tinderbox(object):
(retpid, status) = os.waitpid(childpid, 0)
- if status != 0:
+ if 0 != status:
# something went really wrong, grab all the info we can
print "Something went really bad and we need logging, stat!"
log.error("Emerge of package %s failed with error code: %d" % (pkg, status))
@@ -156,13 +156,13 @@ class Tinderbox(object):
dep_emergepid = os.fork()
# we need to run emerge_main() in child process since a lot of stuff in there
# likes to call sys.exit() and we don't want that do we?
- if dep_emergepid == 0:
+ if 0 == dep_emergepid:
extra_use = dep[0]
os.environ["USE"]=" ".join(extra_use)
sys.argv = ["emerge","--verbose","=%s" % dep[1]]
sys.exit(emerge.emerge_main())
ret = os.waitpid(dep_emergepid, 0)
- if ret[1] != 0:
+ if 0 != ret[1]:
raise Exception("emerge_main() failed with error code %d" % ret)
except Exception, e:
log.error(format_exc())
@@ -186,7 +186,7 @@ class Tinderbox(object):
continue
ret = portage.doebuild(ebuild, "merge", portage.root, settings, debug = False, tree="porttree")
- if ret != 0:
+ if 0 != ret:
# error installing, grab logs
try:
logfile = open("%s/build.log" % settings["T"], "r")
@@ -213,12 +213,12 @@ class Tinderbox(object):
dep_cat, dep_pv = portage.catsplit(dep)
ret = portage.unmerge(dep_cat, dep_pv, portage.root, settings, True, vartree=vartree)
- if ret != 0:
+ if 0 != ret:
log.error("Unable to unmerge dep %s" % dep)
pkg_cat, pkg_pv = portage.catsplit(pkg)
ret = portage.unmerge(pkg_cat, pkg_pv, portage.root, settings, True, vartree=vartree)
- if ret != 0:
+ if 0 != ret:
log.error("Unable to unmerge dep %s" % dep)
@@ -271,7 +271,7 @@ class Tinderbox(object):
if dep[0].startswith('!'):
continue
dep_useflag = list(portage.dep.dep_getusedeps(dep))
- if len(dep_useflag) == 0:
+ if 0 == len(dep_useflag):
dep_useflag = None
depversions = portdb.xmatch('match-all',dep)
depversions = [(dep_useflag,x) for x in depversions]