-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = ['env_update']
# Update prelink.conf if we are prelink-enabled
if prelink_capable:
prelink_d = os.path.join(eroot, 'etc', 'prelink.conf.d')
- if not os.path.isdir(prelink_d):
- os.makedirs(prelink_d)
+ ensure_dirs(prelink_d)
newprelink = atomic_ofstream(os.path.join(prelink_d, 'portage.conf'))
newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n")
newprelink.write("# contents of /etc/env.d directory\n")
# point it to the new stuff until the prelink package re-installs.
prelink_conf = os.path.join(eroot, 'etc', 'prelink.conf')
try:
- with open(prelink_conf, 'rb') as f:
+ with open(_unicode_encode(prelink_conf,
+ encoding=_encodings['fs'], errors='strict'), 'rb') as f:
if f.readline() == b'# prelink.conf autogenerated by env-update; make all changes to\n':
f = atomic_ofstream(prelink_conf)
f.write('-c /etc/prelink.conf.d/*.conf\n')