aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2007-06-05 23:02:36 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2007-06-05 23:02:36 +0000
commitf379e5c032c9b37f6459f004829013f95d66c3dd (patch)
tree0e3c6f59e59778c73afb9cc51aa3d1d756e188c2
parent9b99270189b5504b848265f1616b9a226fe11187 (diff)
downloadpaludis-f379e5c032c9b37f6459f004829013f95d66c3dd.tar.gz
paludis-f379e5c032c9b37f6459f004829013f95d66c3dd.tar.xz
specpath -> specpath.conf Fixes: ticket:282
-rw-r--r--doc/configuration.html.skel10
-rw-r--r--paludis/environments/paludis/paludis_config.cc16
-rwxr-xr-xsrc/clients/paludis/install_TEST_setup.sh2
-rwxr-xr-xsrc/clients/paludis/upgrade_TEST_setup.sh2
4 files changed, 19 insertions, 11 deletions
diff --git a/doc/configuration.html.skel b/doc/configuration.html.skel
index e83c763..36adbc2 100644
--- a/doc/configuration.html.skel
+++ b/doc/configuration.html.skel
@@ -44,8 +44,8 @@ include a literal dollar, use <code>\$</code>.</p>
will use <code>.paludis-thesuffix</code> or <code>paludis-thesuffix</code>
instead.</p>
-<p>If a file named <code>specpath</code> exists in this directory, Paludis uses
-this file to determine the real configuration directory. The <code>specpath</code>
+<p>If a file named <code>specpath.conf</code> exists in this directory, Paludis uses
+this file to determine the real configuration directory. The <code>specpath.conf</code>
file is a standard key / value configuration file (see above). The keys that
are used are:</p>
@@ -53,14 +53,14 @@ are used are:</p>
<li><code>root</code>, which specifies the install root for packages and the
real configuration directory, which is <code>${root}/SYSCONFDIR/paludis/</code>
(note that the HOME values are <em>not</em> used here). This value is set in
- <code>specpath</code> rather than the real configuration directory so
+ <code>specpath.conf</code> rather than the real configuration directory so
that chrooting into an image can work with no configuration changes.</li>
<li><code>config-suffix</code>, which specifies a new configuration suffix. By
default, no configuration suffix is used under root.</li>
</ul>
-<p>If no <code>specpath</code> file is present, the original directory is
+<p>If no <code>specpath.conf</code> file is present, the original directory is
used.</p>
<h3>The environment.conf File</h3>
@@ -248,7 +248,7 @@ such as <code>USE</code> or <code>LINGUAS</code>.</p>
<p>Each file named <code>*.conf</code> in the <code>repositories/</code> subdirectory
creates a repository for Paludis. This is a key = value format file, and the special
-variable <code>${ROOT}</code> is defined based upon <code>specpath</code>. All
+variable <code>${ROOT}</code> is defined based upon <code>specpath.conf</code>. All
files must define a <code>format =</code> key; depending upon the value used, other
optional and mandatory keys are available.</p>
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 8119b84..4427489 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -217,11 +217,19 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
Log::get_instance()->message(ll_debug, lc_no_context, "PaludisConfig initial directory is '"
+ stringify(local_config_dir) + "'");
- if ((local_config_dir / "specpath").exists())
+ // Prefer specpath.conf over specpath. Warn if specpath is used.
+ if ((local_config_dir / "specpath.conf").exists() || (local_config_dir / "specpath").exists())
{
- KeyValueConfigFile specpath(local_config_dir / "specpath", KeyValueConfigFileOptions());
- root_prefix = specpath.get("root");
- local_config_suffix = specpath.get("config-suffix");
+ KeyValueConfigFile* specpath;
+ if ((local_config_dir / "specpath.conf").exists())
+ specpath = new KeyValueConfigFile(local_config_dir / "specpath.conf", KeyValueConfigFileOptions());
+ else
+ {
+ specpath = new KeyValueConfigFile(local_config_dir / "specpath", KeyValueConfigFileOptions());
+ Log::get_instance()->message(ll_warning, lc_no_context, "Using specpath is deprecated, use specpath.conf instead");
+ }
+ root_prefix = specpath->get("root");
+ local_config_suffix = specpath->get("config-suffix");
if (! root_prefix.empty() && stringify(FSEntry(root_prefix).realpath()) != "/")
{
diff --git a/src/clients/paludis/install_TEST_setup.sh b/src/clients/paludis/install_TEST_setup.sh
index 802a9b1..088be44 100755
--- a/src/clients/paludis/install_TEST_setup.sh
+++ b/src/clients/paludis/install_TEST_setup.sh
@@ -6,7 +6,7 @@ cd install_TEST_dir || exit 1
mkdir -p build
mkdir -p config/.paludis-install-test
-cat <<END > config/.paludis-install-test/specpath
+cat <<END > config/.paludis-install-test/specpath.conf
root = `pwd`/root
config-suffix =
END
diff --git a/src/clients/paludis/upgrade_TEST_setup.sh b/src/clients/paludis/upgrade_TEST_setup.sh
index b84768f..f4c3405 100755
--- a/src/clients/paludis/upgrade_TEST_setup.sh
+++ b/src/clients/paludis/upgrade_TEST_setup.sh
@@ -6,7 +6,7 @@ cd upgrade_TEST_dir || exit 1
mkdir -p build
mkdir -p config/.paludis-upgrade-test
-cat <<END > config/.paludis-upgrade-test/specpath
+cat <<END > config/.paludis-upgrade-test/specpath.conf
root = `pwd`/root
config-suffix =
END