[yum-commits] yum-debug-restore.py
James Antill
james at osuosl.org
Wed Nov 9 14:19:21 UTC 2011
yum-debug-restore.py | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit ff2cf6967d2980d13560a7fb6ace52f7743349e6
Author: ZdenÄk Pavlas <zpavlas at redhat.com>
Date: Wed Nov 9 08:49:16 2011 +0100
yum-debug-restore: restore installonly pkgs. BZ 737597.
diff --git a/yum-debug-restore.py b/yum-debug-restore.py
index fd95741..32574a7 100755
--- a/yum-debug-restore.py
+++ b/yum-debug-restore.py
@@ -107,11 +107,15 @@ def pkg_data2list(yb, opkgtups, opkgmaps, install_latest, ignore_arch):
ret = []
npkgtups = set()
npkgmaps = {}
+ installonly = set(yb.conf.installonlypkgs)
for po in sorted(yb.rpmdb.returnPackages()):
arch = po.arch
if ignore_arch:
arch = None
if False: pass
+ elif po.name in installonly:
+ if not po.pkgtup in opkgtups:
+ ret.append(("remove", pkgtup2str(po.pkgtup)))
elif (po.name, arch) not in opkgmaps:
ret.append(("remove", str(po)))
elif po.pkgtup not in opkgtups:
@@ -129,6 +133,8 @@ def pkg_data2list(yb, opkgtups, opkgmaps, install_latest, ignore_arch):
npkgmaps[(po.name, None)] = po
for name, arch in sorted(opkgmaps):
+ if name in installonly:
+ continue # done separately
if ignore_arch and arch is not None:
continue
if (name, arch) in npkgmaps:
@@ -139,6 +145,9 @@ def pkg_data2list(yb, opkgtups, opkgmaps, install_latest, ignore_arch):
ret.append(("install", "%s.%s" % (name, arch)))
else:
ret.append(("install", pkgtup2str(opkgmaps[(name, arch)])))
+ for pkgtup in opkgtups:
+ if pkgtup[0] in installonly and not pkgtup in npkgtups:
+ ret.append(("install", pkgtup2str(pkgtup)))
return ret
def main():
More information about the Yum-commits
mailing list