Browse Source

fixed dependenc purge problem in mail stack

bugfixes
harshadyeola 10 years ago
parent
commit
a740dfba13
  1. 1
      ee/cli/plugins/site.py
  2. 32
      ee/core/aptget.py

1
ee/cli/plugins/site.py

@ -836,7 +836,6 @@ class EESiteUpdateController(CementBaseController):
if oldsitetype == 'mysql': if oldsitetype == 'mysql':
config_file = (ee_site_webroot + '/backup/{0}/ee-config.php' config_file = (ee_site_webroot + '/backup/{0}/ee-config.php'
.format(EEVariables.ee_date)) .format(EEVariables.ee_date))
print(config_file, 'DB_NAME')
data['ee_db_name'] = (EEFileUtils.grep(self, config_file, data['ee_db_name'] = (EEFileUtils.grep(self, config_file,
'DB_NAME') 'DB_NAME')
.split(',')[1] .split(',')[1]

32
ee/core/aptget.py

@ -151,6 +151,8 @@ class EEAptGet():
fprogress = apt.progress.text.AcquireProgress() fprogress = apt.progress.text.AcquireProgress()
iprogress = apt.progress.base.InstallProgress() iprogress = apt.progress.base.InstallProgress()
onelevel = []
my_selected_packages = [] my_selected_packages = []
# Cache Initialization # Cache Initialization
if not cache: if not cache:
@ -176,22 +178,11 @@ class EEAptGet():
# 2) We sequentially remove every package in list # 2) We sequentially remove every package in list
# - via is_auto_installed we check if we can safely remove it # - via is_auto_installed we check if we can safely remove it
deplist = [] deplist = []
onelevel = __dependencies_loop(cache, deplist, pkg, onelevel = onelevel + __dependencies_loop(cache, deplist, pkg,
onelevel=True) onelevel=True)
# Mark for deletion the first package, to fire up # Mark for deletion the first package, to fire up
# auto_removable Purge? # auto_removable Purge?
for dep in onelevel:
my_selected_packages.append(dep.name)
try:
if purge:
dep.mark_delete(purge=True)
else:
dep.mark_delete(purge=False)
except SystemError as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to purge depedencies.")
try: try:
if purge: if purge:
pkg.mark_delete(purge=True) pkg.mark_delete(purge=True)
@ -199,7 +190,20 @@ class EEAptGet():
pkg.mark_delete(purge=False) pkg.mark_delete(purge=False)
except SystemError as e: except SystemError as e:
Log.debug(self, "{0}".format(e)) Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to purge packages.") apt.ProblemResolver(cache).remove(pkg)
# print(pkg.inst_state)
# Log.error(self, "Unable to purge packages.")
for dep in onelevel:
my_selected_packages.append(dep.name)
try:
if purge:
dep.mark_delete(purge=True)
else:
dep.mark_delete(purge=False)
except SystemError as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to purge depedencies.")
# Check if packages available for remove/update. # Check if packages available for remove/update.
if cache.delete_count > 0: if cache.delete_count > 0:

Loading…
Cancel
Save