return "%s sudo chroot %s /bin/sh -c \"export LC_ALL=C; exec < /dev/null; %s\"" \
% (config.sudo_chroot_wrapper, config.chroot, quote(cmd))
-def popen(cmd, user = "builder", mode = "r"):
+def popen(cmd, user = "builder", mode = "r", encoding = None):
if mode == "r":
- p = subprocess.Popen(command(cmd, user), shell=True, stdout=subprocess.PIPE, close_fds=True)
+ p = subprocess.Popen(command(cmd, user), shell=True, stdout=subprocess.PIPE, close_fds=True, encoding=encoding)
f = p.stdout
else:
- p = subprocess.Popen(command(cmd, user), shell=True, stdin=subprocess.PIPE, close_fds=True)
+ p = subprocess.Popen(command(cmd, user), shell=True, stdin=subprocess.PIPE, close_fds=True, encoding=encoding)
f = p.stdin
return f
del killset[p]
errors += "cannot remove %s because it's crucial\n" % p
else:
- f = chroot.popen("poldek --noask --test --test --erase %s" % p, user = "root")
+ f = chroot.popen("poldek --noask --test --test --erase %s" % p, user = "root", encoding = "utf-8")
crucial = 0
e = []
for l in f:
return errors
def upgrade_from_batch(r, b):
- f = chroot.popen("rpm --test -F %s 2>&1" % ' '.join(b.files), user = "root")
+ f = chroot.popen("rpm --test -F %s 2>&1" % ' '.join(b.files), user = "root", encoding = "utf-8")
killset = {}
rx = re.compile(r' \(installed\) (?P<name>[^\s]+)-[^-]+-[^-]+$')
for l in f:
return True
def is_rpmorg():
- f = chroot.popen("rpm --version 2>&1")
+ f = chroot.popen("rpm --version 2>&1", encoding = "utf-8")
v = re.compile(r'(RPM version|rpm \(RPM\)) (?P<major>\d)\.(?P<minor>\d+)(\.\d+)?')
for l in f:
m = v.search(l)
'rpmdefs' : b.rpmbuild_opts(),
'topdir' : b.get_topdir(),
'spec': b.spec,
- })
+ }, encoding = "utf-8")
# java-sun >= 1.5 conflicts with soprano-2.1.67-1.src
# java-sun conflicts with soprano-2.1.67-1.src
rx = re.compile(r"\s+(?P<name>[\w-]+)\s+.*conflicts with [^\s]+-[^-]+-[^-]+\.src($| .*)")
'rpmdefs' : b.rpmbuild_opts(),
'spec': b.spec,
}
- f = chroot.popen(cmd)
+ f = chroot.popen(cmd, encoding = "utf-8")
rx = re.compile(r"^\s*(?P<name>[^\s]+) .*is needed by")
needed = {}
b.log_line("checking BR")
chroot.run("poldek --up --upa", user = "root", logfile = b.logfile)
# check conflicts in BRed packages
b.log_line("checking conflicting packages in BRed packages")
- f = chroot.popen("poldek --test --test --noask --caplookup -Q -v %s --upgrade %s" % (b.ignores(), br), user = "root")
+ f = chroot.popen("poldek --test --test --noask --caplookup -Q -v %s --upgrade %s" % (b.ignores(), br), user = "root", encoding = "utf-8")
# phonon-devel-4.3.1-1.i686 conflicts with qt4-phonon-devel-4.5.0-6.i686
# jdbc-stdext >= 2.0 is required by installed java-struts-1.3.10-1.noarch
# jmx is needed by (installed) java-commons-modeler-2.0-1.noarch