diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-12-08 12:20:54 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-12-08 12:20:54 -0800 |
commit | 4b4ad3579e83fc59be55a1304d483fbbbc95f6f4 (patch) | |
tree | 94234e3cab1b152ac160282b7d4cdca81646c5ec | |
parent | b79dd09c523764f95be882fe1a5afde71cbab81c (diff) | |
download | portage-4b4ad3579e83fc59be55a1304d483fbbbc95f6f4.tar.gz portage-4b4ad3579e83fc59be55a1304d483fbbbc95f6f4.tar.bz2 portage-4b4ad3579e83fc59be55a1304d483fbbbc95f6f4.zip |
dispatch-conf: substitute ${EPREFIX} archive-dir
This allows prefix installs to avoid hardcoding archive-dir.
-rw-r--r-- | cnf/dispatch-conf.conf | 2 | ||||
-rw-r--r-- | pym/portage/dispatch_conf.py | 5 |
2 files changed, 6 insertions, 1 deletions
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 |