fix remove package with dependencies

This commit is contained in:
Dimitris Zlatanidis 2015-02-16 13:06:12 +02:00
parent 1c3aaf1f7f
commit f972d203fb

View file

@ -116,9 +116,8 @@ class PackageManager(object):
if os.path.isfile(dep_path + rmv) and _m.del_deps == "on": if os.path.isfile(dep_path + rmv) and _m.del_deps == "on":
dependencies = self._view_deps(dep_path, rmv) dependencies = self._view_deps(dep_path, rmv)
if self._rmv_deps_answer() in ['y', 'Y']: if self._rmv_deps_answer() in ['y', 'Y']:
rmv_list += self._rmv_deps(self.binary, rmv_list += (self._rmv_deps(dependencies, dep_path,
dependencies, rmv))
dep_path, rmv)
else: else:
rmv_list += self._rmv_pkg(rmv) rmv_list += self._rmv_pkg(rmv)
os.remove(dep_path + rmv) os.remove(dep_path + rmv)
@ -175,13 +174,13 @@ class PackageManager(object):
Msg().template(78) Msg().template(78)
return dependencies return dependencies
def _rmv_deps(self, binary, dependencies, path, package): def _rmv_deps(self, dependencies, path, package):
''' '''
Remove dependencies Remove dependencies
''' '''
removes = [] removes = []
deps = dependencies.split() deps = dependencies.split()
deps.append(''.join(binary)) deps.append(package)
for dep in deps: for dep in deps:
if find_package(dep + _m.sp, _m.pkg_path): if find_package(dep + _m.sp, _m.pkg_path):
print(subprocess.check_output("removepkg {0}".format(dep), print(subprocess.check_output("removepkg {0}".format(dep),