public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/, cnf/
@ 2011-12-08 20:21 Zac Medico
  0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2011-12-08 20:21 UTC (permalink / raw
  To: gentoo-commits

commit:     4b4ad3579e83fc59be55a1304d483fbbbc95f6f4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  8 20:20:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec  8 20:20:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b4ad357

dispatch-conf: substitute ${EPREFIX} archive-dir

This allows prefix installs to avoid hardcoding archive-dir.

---
 cnf/dispatch-conf.conf       |    2 +-
 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 c4ab33f..7eea44c 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 f5beba5..abd3ac1 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-08 20:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08 20:21 [gentoo-commits] proj/portage:master commit in: pym/portage/, cnf/ Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox