vartree=self.vartree)
# XXX: Decide how to handle failures here.
- if a != 0:
+ if a != os.EX_OK:
writemsg("!!! FAILED preinst: "+str(a)+"\n", noiselevel=-1)
- sys.exit(123)
+ return a
# copy "info" files (like SLOT, CFLAGS, etc.) into the database
for x in listdir(inforoot):
tree=self.treetype, mydbapi=mydbapi, vartree=self.vartree)
# XXX: Decide how to handle failures here.
- if a != 0:
+ if a != os.EX_OK:
writemsg("!!! FAILED postinst: "+str(a)+"\n", noiselevel=-1)
- sys.exit(123)
+ return a
downgrade = False
for v in otherversions:
if "noclean" not in self.settings.features:
doebuild(myebuild, "clean", destroot, self.settings,
tree=self.treetype, mydbapi=mydbapi, vartree=self.vartree)
- return 0
+ return os.EX_OK
def mergeme(self,srcroot,destroot,outfile,secondhand,stufftomerge,cfgfiledict,thismtime):
"""
vartree = db[myroot]["vartree"]
if mytbz2[-5:]!=".tbz2":
print "!!! Not a .tbz2 file"
- return None
+ return 1
tbz2_lock = None
builddir_lock = None
if not mycat:
writemsg("!!! CATEGORY info missing from info chunk, aborting...\n",
noiselevel=-1)
- return None
+ return 1
mycat = mycat.strip()
# These are the same directories that would be used at build time.
tree="bintree", mydbapi=mydbapi, vartree=vartree)
if retval != os.EX_OK:
writemsg("!!! Setup failed: %s\n" % retval, noiselevel=-1)
- return None
+ return retval
writemsg_stdout(">>> Extracting %s\n" % mypkg)
retval = portage_exec.spawn_bash(
env=mysettings.environ())
if retval != os.EX_OK:
writemsg("!!! Error Extracting '%s'\n" % mytbz2, noiselevel=-1)
- return None
+ return retval
#portage_locks.unlockfile(tbz2_lock)
#tbz2_lock = None
mylink = dblink(mycat, mypkg, myroot, mysettings, vartree=vartree,
treetype="bintree")
- mylink.merge(pkgloc, infloc, myroot, myebuild, cleanup=0,
+ retval = mylink.merge(pkgloc, infloc, myroot, myebuild, cleanup=0,
mydbapi=mydbapi, prev_mtimes=prev_mtimes)
-
- try:
- f = open(os.path.join(infloc, "RDEPEND", "r"))
- try:
- return " ".join(f.read().split())
- finally:
- f.close()
- except (IOError, OSError):
- return ""
+ return retval
finally:
if tbz2_lock:
portage_locks.unlockfile(tbz2_lock)