commit 44d52530e16e7ed3c3e428315ddbb44e154bc839
Author: Marko Saukko <[email protected]>
Date: Mon Jan 24 12:50:21 2011 +0200
Break out of the loop when it is possible.
diff --git a/mic/imgcreate/pkgmanagers/zypperpkgmgr.py
b/mic/imgcreate/pkgmanagers/zypperpkgmgr.py
index 8a0ef60..cec8912 100644
--- a/mic/imgcreate/pkgmanagers/zypperpkgmgr.py
+++ b/mic/imgcreate/pkgmanagers/zypperpkgmgr.py
@@ -125,6 +125,7 @@ class Zypper:
if name not in self.packages:
self.packages.append(name)
item.status().setToBeInstalled (zypp.ResStatus.USER)
+ break
if found:
return None
@@ -138,17 +139,16 @@ class Zypper:
"""Deselect package. Can be specified as name.arch or name*"""
sp = pkg.rsplit(".", 2)
- found = False
for item in self.Z.pool():
kind = "%s" % item.kind()
if kind == "package":
name = "%s" % item.name()
if name == sp[0]:
- found = True
- if item.status().isInstalled():
+ if item.status().isInstalled():
item.status().setToBeUninstalled (zypp.ResStatus.USER)
if name in self.packages:
self.packages.remove(name)
+ break
def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT):
@@ -165,6 +165,8 @@ class Zypper:
if name not in self.patterns:
self.patterns.append(name)
item.status().setToBeInstalled (zypp.ResStatus.USER)
+ break
+
if found:
if include == pykickstart.parser.GROUP_REQUIRED:
map(lambda p: self.deselectPackage(p),
grp.default_packages.keys())
_______________________________________________
MeeGo-distribution-tools mailing list
[email protected]
http://lists.meego.com/listinfo/meego-distribution-tools