From 56082127bb2cf14cf744d88f3b3022b8b7742d31 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 14 Aug 2015 06:02:31 +0300 Subject: [PATCH] Fix check file exists --- slpkg/status_deps.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/slpkg/status_deps.py b/slpkg/status_deps.py index 8a96a36b..68dc4dd1 100644 --- a/slpkg/status_deps.py +++ b/slpkg/status_deps.py @@ -22,6 +22,7 @@ # along with this program. If not, see . +import os import sys from utils import Utils @@ -56,17 +57,18 @@ class DependenciesStatus(object): dictionary database """ for pkg in self.installed: - name = split_package(pkg)[0] - for log in self.logs: - deps = Utils().read_file(self.dep_path + log) - for dep in deps.splitlines(): - if name == dep: - if name not in self.dmap.keys(): - self.dmap[name] = [log] - self.count_dep += 1 - else: - self.dmap[name] += [log] - self.count_pkg += 1 + if os.path.isfile(self.meta.pkg_path + pkg): + name = split_package(pkg)[0] + for log in self.logs: + deps = Utils().read_file(self.dep_path + log) + for dep in deps.splitlines(): + if name == dep: + if name not in self.dmap.keys(): + self.dmap[name] = [log] + self.count_dep += 1 + else: + self.dmap[name] += [log] + self.count_pkg += 1 def show(self): """Show dependencies status