From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/, cnf/
Date: Thu, 8 Dec 2011 20:21:49 +0000 (UTC) [thread overview]
Message-ID: <4b4ad3579e83fc59be55a1304d483fbbbc95f6f4.zmedico@gentoo> (raw)
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
reply other threads:[~2011-12-08 20:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4b4ad3579e83fc59be55a1304d483fbbbc95f6f4.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox