Browse Source

fixed web purge

bugfixes
harshadyeola 10 years ago
parent
commit
e648e0f8e0
  1. 9
      ee/core/apt_repo.py
  2. 30
      ee/core/aptget.py
  3. 4
      ee/core/variables.py

9
ee/core/apt_repo.py

@ -11,7 +11,6 @@ class EERepo():
pass
def add(self, repo_url=None, ppa=None):
# TODO add repository code
if repo_url is not None:
repo_file_path = ("/etc/apt/sources.list.d/"
@ -27,10 +26,11 @@ class EERepo():
repofile.close()
return True
except IOError as e:
print("File I/O error({0}): {1}".format(e.errno, e.strerror))
Log.debug(self, "{0}".format(e))
Log.error(self, "File I/O error.")
except Exception as e:
print("{error}".format(error=e))
return False
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to add repo")
if ppa is not None:
if EEVariables.ee_platform_distro == 'squeeze':
print("Cannot add repo for {distro}"
@ -41,7 +41,6 @@ class EERepo():
.format(ppa_name=ppa))
def remove(self, repo_url=None):
# TODO remove repository
EEShellExec.cmd_exec(self, "add-apt-repository -y "
"--remove '{ppa_name}'"
.format(ppa_name=repo_url))

30
ee/core/aptget.py

@ -59,7 +59,7 @@ class EEAptGet():
.format(space=cache.required_space))
try:
# Commit changes in cache (actually install)
cache.commit(fprogress, iprogress)
cache.commit(fprogress, iprogres)
except Exception as e:
print("package installation failed. [{err}]"
.format(err=str(e)))
@ -111,8 +111,8 @@ class EEAptGet():
.format(pkg_install_count=cache.install_count))
print("Need to get {req_download} bytes of archives"
.format(req_download=cache.required_download))
print("After this operation, {space} bytes of"
"additional disk space will be used."
print("After this operation, {space:.2f} MB of"
" additional disk space will be used."
.format(space=cache.required_space/1e6))
try:
# Commit changes in cache (actually install)
@ -182,16 +182,16 @@ class EEAptGet():
# Mark for deletion the first package, to fire up
# 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.")
# 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:
if purge:
@ -211,8 +211,8 @@ class EEAptGet():
print("{pkg_remove_count} to remove."
.format(pkg_remove_count=cache.delete_count))
# app.log.debug('bytes disk space will be freed')
print("After this operation, {space} bytes disk spac"
"e will be freed.".format(space=cache.required_space))
print("After this operation, {space:.2f} MB disk space "
"will be freed.".format(space=cache.required_space/1e6))
try:
cache.commit(fprogress, iprogress)
except Exception as e:

4
ee/core/variables.py

@ -81,9 +81,9 @@ class EEVariables():
elif ee_platform_codename == 'wheezy':
ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php55 all"
.format(codename=ee_platform_codename))
ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-cli", "php5-imap",
ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap",
"php5-mcrypt", "php5-xdebug", "php5-common", "php5-readline",
"php5-mysql", "memcached"]
"php5-mysql", "php5-cli", "memcached"]
# MySQL repo and packages
ee_mysql_repo = ("deb http://repo.percona.com/apt {codename} main"

Loading…
Cancel
Save