From: Zac Medico Date: Thu, 8 Dec 2011 20:20:54 +0000 (-0800) Subject: dispatch-conf: substitute ${EPREFIX} archive-dir X-Git-Tag: v2.2.0_alpha80~51 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4b4ad3579e83fc59be55a1304d483fbbbc95f6f4;p=portage.git dispatch-conf: substitute ${EPREFIX} archive-dir This allows prefix installs to avoid hardcoding archive-dir. --- diff --git a/cnf/dispatch-conf.conf b/cnf/dispatch-conf.conf index c4ab33f99..7eea44c8e 100644 --- a/cnf/dispatch-conf.conf +++ b/cnf/dispatch-conf.conf @@ -3,7 +3,7 @@ # # Directory to archive replaced configs -archive-dir=/etc/config-archive +archive-dir=${EPREFIX}/etc/config-archive # Use rcs for storing files in the archive directory? # WARNING: When configured to use rcs, read and execute permissions of diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py index f5beba5c0..abd3ac141 100644 --- a/pym/portage/dispatch_conf.py +++ b/pym/portage/dispatch_conf.py @@ -13,6 +13,7 @@ import os, sys, shutil import portage from portage.env.loaders import KeyValuePairFileLoader from portage.localization import _ +from portage.util import varexpand RCS_BRANCH = '1.1.1' RCS_LOCK = 'rcs -ko -M -l' @@ -59,6 +60,10 @@ def read_config(mandatory_opts): else: print(_('dispatch-conf: Missing option "%s" in /etc/dispatch-conf.conf; fatal') % (key,), file=sys.stderr) + # archive-dir supports ${EPREFIX} expansion, in order to avoid hardcoding + variables = {"EPREFIX": eprefix} + opts['archive-dir'] = varexpand(opts['archive-dir'], mydict=variables) + if not os.path.exists(opts['archive-dir']): os.mkdir(opts['archive-dir']) # Use restrictive permissions by default, in order to protect