diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 27f22e10..01c00bcb 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -58,6 +58,11 @@ class EEStackController(CementBaseController): dict(help='Install Utils stack', action='store_true')), ] + @expose(hide=True) + def package_check(self, packages=[]): + # Function for packages check + pass + @expose(hide=True) def default(self): # TODO Default action for ee stack command diff --git a/ee/core/aptget.py b/ee/core/aptget.py index efa35f41..e2ed5960 100644 --- a/ee/core/aptget.py +++ b/ee/core/aptget.py @@ -215,3 +215,16 @@ class EEAptGet: .format(err=str(e))) return(False) return(True) + + def is_installed(self, package): + # Cache Initialization + if not self.cache: + self.cache = apt.Cache() + # Cache Read + self.cache.open() + pkg = self.cache[package] + # Check Package Installed + if pkg.is_installed: + return True + else: + return False