declare -p
declare -fp
+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
+ export
+ fi
)
}
# Reload the whole config from scratch.
settings, trees, mtimedb = load_emerge_config(trees=trees)
+ adjust_configs(myopts, trees)
root_config = trees[settings["ROOT"]]["root_config"]
portdb = trees[settings["ROOT"]]["porttree"].dbapi
mtimedb.commit()
# Reload the whole config from scratch.
settings, trees, mtimedb = load_emerge_config(trees=trees)
+ adjust_configs(myopts, trees)
portdb = trees[settings["ROOT"]]["porttree"].dbapi
root_config = trees[settings["ROOT"]]["root_config"]
return rval
+def adjust_configs(myopts, trees):
+ for myroot in trees:
+ mysettings = trees[myroot]["vartree"].settings
+ mysettings.unlock()
+ adjust_config(myopts, mysettings)
+ mysettings.lock()
+
def adjust_config(myopts, settings):
"""Make emerge specific adjustments to the config."""
from _emerge.actions import action_config, action_sync, action_metadata, \
action_regen, action_search, action_uninstall, action_info, action_build, \
- adjust_config, chk_updated_cfg_files, display_missing_pkg_set, \
+ adjust_configs, chk_updated_cfg_files, display_missing_pkg_set, \
display_news_notification, getportageversion, load_emerge_config
from _emerge.emergelog import emergelog
from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
settings, trees, mtimedb = load_emerge_config(trees=trees)
portdb = trees[settings["ROOT"]]["porttree"].dbapi
- for myroot in trees:
- mysettings = trees[myroot]["vartree"].settings
- mysettings.unlock()
- adjust_config(myopts, mysettings)
- mysettings.lock()
- del myroot, mysettings
-
+ adjust_configs(myopts, trees)
apply_priorities(settings)
spinner = stdout_spinner()
# Distributed under the terms of the GNU General Public License v2
# $Id$
-from email.mime.text import MIMEText as TextMessage
+from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart as MultipartMessage
from email.mime.base import MIMEBase as BaseMessage
from email.header import Header
if sys.hexversion >= 0x3000000:
basestring = str
+if sys.hexversion >= 0x3000000:
+ def TextMessage(_text):
+ return MIMEText(_text, _charset="UTF-8")
+else:
+ TextMessage = MIMEText
+
def create_message(sender, recipient, subject, body, attachments=None):
if sys.hexversion < 0x3000000:
myconn = smtplib.SMTP(mymailhost, mymailport)
if mymailuser != "" and mymailpasswd != "":
myconn.login(mymailuser, mymailpasswd)
- msg = _unicode_encode(message.as_string(),
- encoding=_encodings['content'], errors='backslashreplace')
- myconn.sendmail(myfrom, myrecipient, msg)
+ myconn.sendmail(myfrom, myrecipient, message.as_string())
myconn.quit()
except smtplib.SMTPException as e:
raise portage.exception.PortageException(_("!!! An error occured while trying to send logmail:\n")+str(e))