[Yum-devel] [PATCH 2/2] move return_running_packages to rpmsack from yumbase b/c it belongs there :)
Seth Vidal
skvidal at fedoraproject.org
Wed Dec 9 18:18:18 UTC 2009
---
yum/__init__.py | 10 ----------
yum/rpmsack.py | 12 ++++++++++++
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/yum/__init__.py b/yum/__init__.py
index bd16d78..9613378 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4195,13 +4195,3 @@ class YumBase(depsolve.Depsolve):
return True
- def return_running_packages(self):
- """returns a list of yum installed package objects which own a file
- that are currently running or in use."""
- pkgs = {}
- for pid in misc.return_running_pids():
- for fn in misc.get_open_files(pid):
- for pkg in self.rpmdb.searchFiles(fn):
- pkgs[pkg] = 1
-
- return sorted(pkgs.keys())
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 151e33e..d6b524a 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -716,6 +716,18 @@ class RPMDBPackageSack(PackageSackBase):
# XXX deprecate?
return [po.pkgtup for po in self.getRequires(name, flags, version)]
+ def return_running_packages(self):
+ """returns a list of yum installed package objects which own a file
+ that are currently running or in use."""
+ pkgs = {}
+ for pid in misc.return_running_pids():
+ for fn in misc.get_open_files(pid):
+ for pkg in self.searchFiles(fn):
+ pkgs[pkg] = 1
+
+ return sorted(pkgs.keys())
+
+
def _sanitize(path):
return path.replace('/', '').replace('~', '')
--
1.6.5.2
More information about the Yum-devel
mailing list