xsplit=portage.pkgsplit(x[2])
emergelog(xterm_titles, " >>> AUTOCLEAN: " + xsplit[0])
retval = unmerge_overlapping(x[2], x[1],
- self.pkgsettings, self.trees[x[1]]["vartree"])
+ self.pkgsettings, self.trees[x[1]]["vartree"],
+ ldpath_mtimes)
if not retval:
emergelog(xterm_titles,
" --- AUTOCLEAN: Nothing unmerged.")
else:
sys.exit(0)
-def unmerge_overlapping(pkg_key, myroot, mysettings, vartree):
+def unmerge_overlapping(pkg_key, myroot, mysettings, vartree, ldpath_mtimes):
"""Unmerge any packages that overlap with the given package (overlapping
packages fill the same SLOT). Unlike emerge's unmerge() function, this
function does not assume that packages are to be unmerged from the target
emergelog(xterm_titles, "=== Unmerging... (%s)" % other_pkg)
mysplit = other_pkg.split("/")
retval = portage.unmerge(mysplit[0], mysplit[1], myroot,
- mysettings, mytrimworld=False, vartree=vartree)
+ mysettings, mytrimworld=False, vartree=vartree,
+ ldpath_mtimes=ldpath_mtimes)
if retval:
emergelog(xterm_titles, " !!! unmerge FAILURE: " + other_pkg)
else:
return 0
def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
- raise_on_missing=True):
+ ldpath_mtimes, raise_on_missing=True):
candidate_catpkgs=[]
global_unmerge=0
xterm_titles = "notitles" not in settings.features
mysplit=string.split(y,"/")
#unmerge...
retval = portage.unmerge(mysplit[0], mysplit[1], settings["ROOT"],
- mysettings, unmerge_action not in ["clean","prune"])
+ mysettings, unmerge_action not in ["clean","prune"],
+ vartree=vartree, ldpath_mtimes=ldpath_mtimes)
if retval:
emergelog(xterm_titles, " !!! unmerge FAILURE: "+y)
else:
xterm_titles = "notitles" not in settings.features
vartree = trees[settings["ROOT"]]["vartree"]
info_mtimes = portage.mtimedb["info"]
+ ldpath_mtimes = portage.mtimedb["ldpath"]
syslist = getlist(settings, "system")
worldlist = getlist(settings, "world")
myvarlist = vartree.dbapi.cp_all()
#print
if len(cleanlist):
- unmerge(settings, myopts, vartree, "unmerge", cleanlist)
+ unmerge(settings, myopts, vartree, "unmerge", cleanlist, ldpath_mtimes)
print
print "Packages installed: "+str(len(myvarlist))
def action_build(settings, portdb, trees, myopts, myaction, myfiles, spinner):
info_mtimes = portage.mtimedb["info"]
+ ldpath_mtimes = portage.mtimedb["ldpath"]
favorites=[]
if ("--ask" in myopts or "--pretend" in myopts) and not "--quiet" in myopts:
action = ""
if settings["AUTOCLEAN"] and "yes"==settings["AUTOCLEAN"]:
print ">>> Auto-cleaning packages..."
vartree = trees[settings["ROOT"]]["vartree"]
- unmerge(settings, myopts, vartree, "clean", ["world"])
+ unmerge(settings, myopts, vartree, "clean", ["world"],
+ ldpath_mtimes)
else:
portage.writemsg_stdout(colorize("WARN", "WARNING:")
+ " AUTOCLEAN is disabled. This can cause serious"
portdb = portage.portdb
trees = portage.db
info_mtimes = portage.mtimedb["info"]
+ ldpath_mtimes = portage.mtimedb["ldpath"]
xterm_titles = "notitles" not in settings.features
settings.unlock()
elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction:
vartree = trees[settings["ROOT"]]["vartree"]
if 1 == unmerge(settings, myopts, vartree, myaction, myfiles,
- raise_on_missing=False):
+ ldpath_mtimes, raise_on_missing=False):
if "--pretend" not in myopts:
post_emerge(settings, info_mtimes, 0)
return mylink.merge(pkgloc, infloc, myroot, myebuild,
mydbapi=mydbapi, prev_mtimes=prev_mtimes)
-def unmerge(cat, pkg, myroot, mysettings, mytrimworld=1, vartree=None):
+def unmerge(cat, pkg, myroot, mysettings, mytrimworld=1, vartree=None, ldpath_mtimes=None):
mylink = dblink(
cat, pkg, myroot, mysettings, treetype="vartree", vartree=vartree)
if mylink.exists():
- mylink.unmerge(trimworld=mytrimworld,cleanup=1)
+ mylink.unmerge(trimworld=mytrimworld, cleanup=1,
+ ldpath_mtimes=ldpath_mtimes)
mylink.delete()
return 0
return 1