else:
msger.warning("No such package %s to remove" %(pkg,))
- def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
+ def selectGroup(self, grp, include = ksparser.constants.GROUP_DEFAULT):
try:
yum.YumBase.selectGroup(self, grp)
if include == ksparser.GROUP_REQUIRED:
import urllib.parse
import rpm
import glob
+import functools
import zypp #pylint: disable=import-error
if not hasattr(zypp, 'PoolQuery') or \
for pitem in sorted(
q.queryResults(self.Z.pool()),
- cmp=lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y)),
+ key=functools.cmp_to_key(lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y))),
reverse=True):
item = zypp.asKindPackage(pitem)
if item.name() in list(self.excpkgs.keys()) and \
for pitem in sorted(
q.queryResults(self.Z.pool()),
- cmp=lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y)),
+ key=functools.cmp_to_key(lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y))),
reverse=True):
item = zypp.asKindPackage(pitem)
if item.name() in list(self.excpkgs.keys()) and \
"""collect packages should not be installed"""
self.to_deselect.append(pkg)
- def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
+ def selectGroup(self, grp, include = ksparser.constants.GROUP_DEFAULT):
def compareGroup(pitem):
item = zypp.asKindPattern(pitem)
return item.repoInfo().priority()
for problem in probs:
msger.warning("repo problem: %s, %s" \
- % (problem.description().decode("utf-8"),
- problem.details().decode("utf-8")))
+ % (problem.description(),
+ problem.details()))
raise RepoError("found %d resolver problem, abort!" \
% len(probs))
parser.set_defaults(alias="cr")
- subparsers = parser.add_subparsers(title='Subcommands' )
+ subparsers = parser.add_subparsers(title='Subcommands', dest='subcommand')
subparsers.required = True
auto_parser = subparsers.add_parser('auto', parents=[parent_parser], help='auto detect image type from magic header')