From e648e0f8e001e26159f5c6556df217def62638f5 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Tue, 20 Jan 2015 15:50:30 +0530 Subject: [PATCH] fixed web purge --- ee/core/apt_repo.py | 9 ++++----- ee/core/aptget.py | 30 +++++++++++++++--------------- ee/core/variables.py | 4 ++-- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ee/core/apt_repo.py b/ee/core/apt_repo.py index bdf17cfd..71a0b450 100644 --- a/ee/core/apt_repo.py +++ b/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)) diff --git a/ee/core/aptget.py b/ee/core/aptget.py index cfa7509c..d81cb876 100644 --- a/ee/core/aptget.py +++ b/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: diff --git a/ee/core/variables.py b/ee/core/variables.py index 3b0c5cd7..262bf730 100644 --- a/ee/core/variables.py +++ b/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"