Browse Source

Added function for package check

bugfixes
gau1991 10 years ago
parent
commit
76848ee6a6
  1. 5
      ee/cli/plugins/stack.py
  2. 13
      ee/core/aptget.py

5
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

13
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

Loading…
Cancel
Save