diff --git a/src/mio/daemon_cage.py b/src/mio/daemon_cage.py index 8a24ba52fd1c11ed82c33509ea1f181525a6fbf0..50cded9347f2ecdd8249709867c14b81527b6e9a 100755 --- a/src/mio/daemon_cage.py +++ b/src/mio/daemon_cage.py @@ -9,7 +9,7 @@ import sys import time def system(command): - null = file("/dev/null") + null = open("/dev/null") p = subprocess.Popen(command, stdin=null, stdout=subprocess.PIPE, diff --git a/src/mio/installer.py b/src/mio/installer.py index 678287bf14dcffac0dfa157d61d00c453ee00e76..d2f6c47f71f146ee3c3f65ed3cd48b0bc6e54301 100755 --- a/src/mio/installer.py +++ b/src/mio/installer.py @@ -189,19 +189,17 @@ class Installer: return rpms def install_rpms(self, path, exclude): - rpm = [] + rpm = set() version_db = mio.rpmDB.VersionDB() for r in self.rpm: r.old_version = version_db[r.name] if r.old_version == None: - rpm.append(r.name) + rpm.add(r.name) pass pass def not_excluded(name): - return not any(map(lambda x: fnmatch.fnmatch(name, x), exclude)) - rpm = filter(not_excluded, rpm) - #rpm.sort() - print(rpm) + return not any([fnmatch.fnmatch(name, x) for x in exclude]) + rpm = sorted(list(filter(not_excluded, rpm))) result = mio.yum.run(path + self.rpmdir, rpm, exclude) version_db = mio.rpmDB.VersionDB() for r in self.rpm: @@ -235,7 +233,7 @@ def exclusion_closure(exclude, target): else: result = list(exclude) # Create exclusion closure for e in target._exclude_: - for (key, value) in e._attribute.iteritems(): + for (key, value) in e._attribute.items(): if key == 'dependency': result.append(group_node(value)) elif key == 'file': diff --git a/src/mio/yum.py b/src/mio/yum.py index a8eab0ce7a35f71a3e0a2790c9e83b4aef174dc1..ccf760efab4b739d9f1e9a59a4d74355d1bbd9f9 100755 --- a/src/mio/yum.py +++ b/src/mio/yum.py @@ -74,7 +74,7 @@ def conf(path): def run(path, rpm, exclude): c = conf(path) f = mio.filecache.createfile() - f.write(c) + f.write(c.encode('ascii')) f.close() mio.log.log(VERBOSE, "%s %s %s\n%s\n%s %s %s" % (