04f8ad
From c6f460b4bb60352e40e25efe72acd3c2bd14f216 Mon Sep 17 00:00:00 2001
04f8ad
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
04f8ad
Date: Wed, 28 Jan 2015 13:21:10 +0100
04f8ad
Subject: [PATCH] Replace configuration directory string with a marker
04f8ad
MIME-Version: 1.0
04f8ad
Content-Type: text/plain; charset=UTF-8
04f8ad
Content-Transfer-Encoding: 8bit
04f8ad
04f8ad
This allows to redefine the configuration directory name at build
04f8ad
time.
04f8ad
04f8ad
Signed-off-by: Petr Písař <ppisar@redhat.com>
04f8ad
---
04f8ad
 Makefile.PL              | 10 +++++-----
04f8ad
 README                   | 10 +++++-----
04f8ad
 lib/CPAN.pm              | 10 +++++-----
04f8ad
 lib/CPAN/HandleConfig.pm |  2 +-
04f8ad
 scripts/cpan-mirrors     |  2 +-
04f8ad
 5 files changed, 17 insertions(+), 17 deletions(-)
04f8ad
04f8ad
diff --git a/Makefile.PL b/Makefile.PL
04f8ad
index 2cd2f82..3b826cf 100644
04f8ad
--- a/Makefile.PL
04f8ad
+++ b/Makefile.PL
04f8ad
@@ -339,21 +339,21 @@ record-session :
04f8ad
 	$(PERL) -Ilib -MCPAN -e '$$CPAN::Suppress_readline=$$CPAN::Echo_readline=1;shell' | tee ttt.out
04f8ad
 
04f8ad
 run-with-sqlite :
04f8ad
-	$(PERL) -I$$HOME/.cpan -Ilib -MCPAN::SQLite -MCPAN::MyConfig -MCPAN -e '$$CPAN::Config->{use_sqlite}++; $$CPAN::Config->{sqlite_dbname}="cpandb-sqlite"; shell'
04f8ad
+	$(PERL) -I$$HOME/.XCPANCONFIGNAMEX -Ilib -MCPAN::SQLite -MCPAN::MyConfig -MCPAN -e '$$CPAN::Config->{use_sqlite}++; $$CPAN::Config->{sqlite_dbname}="cpandb-sqlite"; shell'
04f8ad
 
04f8ad
 testrun_very_offline : rm_mirrored_by run_emu_offline
04f8ad
 
04f8ad
 testrun_emu_offline :
04f8ad
-	$(PERL) -I$$HOME/.cpan -Ilib -MCPAN::MyConfig -MCPAN -e '@CPAN::Defaultsites = qw(file:///dev/null); $$CPAN::Config->{urllist} = []; shell'
04f8ad
+	$(PERL) -I$$HOME/.XCPANCONFIGNAMEX -Ilib -MCPAN::MyConfig -MCPAN -e '@CPAN::Defaultsites = qw(file:///dev/null); $$CPAN::Config->{urllist} = []; shell'
04f8ad
 
04f8ad
 rm_mirrored_by :
04f8ad
-	rm -f $$HOME/.cpan/sources/MIRRORED.BY*
04f8ad
+	rm -f $$HOME/.XCPANCONFIGNAMEX/sources/MIRRORED.BY*
04f8ad
 
04f8ad
 testrun_http_only :
04f8ad
-	$(PERL) -I$$HOME/.cpan -Ilib -MCPAN::MyConfig -MCPAN -e '$$CPAN::Config->{urllist} = [qw(http://www.planet-elektronik.de/CPAN/)]; shell'
04f8ad
+	$(PERL) -I$$HOME/.XCPANCONFIGNAMEX -Ilib -MCPAN::MyConfig -MCPAN -e '$$CPAN::Config->{urllist} = [qw(http://www.planet-elektronik.de/CPAN/)]; shell'
04f8ad
 
04f8ad
 urllist :
04f8ad
-	$(PERL) -Ilib -MCPAN -MCPAN::FirstTime -e 'CPAN::FirstTime::init("$$ENV{HOME}/.cpan/CPAN/MyConfig", args => [qw(urllist)])'
04f8ad
+	$(PERL) -Ilib -MCPAN -MCPAN::FirstTime -e 'CPAN::FirstTime::init("$$ENV{HOME}/.XCPANCONFIGNAMEX/CPAN/MyConfig", args => [qw(urllist)])'
04f8ad
 
04f8ad
 runadmin :
04f8ad
 	$(PERL) -Ilib -MCPAN::Admin -eshell
04f8ad
diff --git a/README b/README
04f8ad
index aaf3101..2618d71 100644
04f8ad
--- a/README
04f8ad
+++ b/README
04f8ad
@@ -269,7 +269,7 @@ DESCRIPTION
04f8ad
       restarting the whole get/make/test/install procedure from scratch.
04f8ad
 
04f8ad
     Lockfile
04f8ad
-      Interactive sessions maintain a lockfile, by default "~/.cpan/.lock".
04f8ad
+      Interactive sessions maintain a lockfile, by default "~/.XCPANCONFIGNAMEX/.lock".
04f8ad
       Batch jobs can run without a lockfile and not disturb each other.
04f8ad
 
04f8ad
       The shell offers to run in *downgraded mode* when another process is
04f8ad
@@ -329,7 +329,7 @@ DESCRIPTION
04f8ad
         "install_tested".
04f8ad
 
04f8ad
   mkmyconfig
04f8ad
-    mkmyconfig() writes your own CPAN::MyConfig file into your "~/.cpan/"
04f8ad
+    mkmyconfig() writes your own CPAN::MyConfig file into your "~/.XCPANCONFIGNAMEX/"
04f8ad
     directory so that you can save your own preferences instead of the
04f8ad
     system-wide ones.
04f8ad
 
04f8ad
@@ -530,7 +530,7 @@ CONFIGURATION
04f8ad
 
04f8ad
     Default values defined in the CPAN/Config.pm file can be overridden in a
04f8ad
     user specific file: CPAN/MyConfig.pm. Such a file is best placed in
04f8ad
-    "$HOME/.cpan/CPAN/MyConfig.pm", because "$HOME/.cpan" is added to the
04f8ad
+    "$HOME/.XCPANCONFIGNAMEX/CPAN/MyConfig.pm", because "$HOME/.XCPANCONFIGNAMEX" is added to the
04f8ad
     search path of the CPAN module before the use() or require() statements.
04f8ad
     The mkmyconfig command writes this file for you.
04f8ad
 
04f8ad
@@ -1996,8 +1996,8 @@ FAQ
04f8ad
 
04f8ad
         You may want to configure something like
04f8ad
 
04f8ad
-          o conf make_arg "| tee -ai /root/.cpan/logs/make.out"
04f8ad
-          o conf make_install_arg "| tee -ai /root/.cpan/logs/make_install.out"
04f8ad
+          o conf make_arg "| tee -ai /root/.XCPANCONFIGNAMEX/logs/make.out"
04f8ad
+          o conf make_install_arg "| tee -ai /root/.XCPANCONFIGNAMEX/logs/make_install.out"
04f8ad
 
04f8ad
         so that STDOUT is captured in a file for later inspection.
04f8ad
 
04f8ad
diff --git a/lib/CPAN.pm b/lib/CPAN.pm
04f8ad
index 4f02850..2c117b4 100644
04f8ad
--- a/lib/CPAN.pm
04f8ad
+++ b/lib/CPAN.pm
04f8ad
@@ -1745,7 +1745,7 @@ restarting the whole get/make/test/install procedure from scratch.
04f8ad
 
04f8ad
 =item Lockfile
04f8ad
 
04f8ad
-Interactive sessions maintain a lockfile, by default C<~/.cpan/.lock>.
04f8ad
+Interactive sessions maintain a lockfile, by default C<~/.XCPANCONFIGNAMEX/.lock>.
04f8ad
 Batch jobs can run without a lockfile and not disturb each other.
04f8ad
 
04f8ad
 The shell offers to run in I<downgraded mode> when another process is
04f8ad
@@ -1819,7 +1819,7 @@ C<install_tested>.
04f8ad
 
04f8ad
 =head2 mkmyconfig
04f8ad
 
04f8ad
-mkmyconfig() writes your own CPAN::MyConfig file into your C<~/.cpan/>
04f8ad
+mkmyconfig() writes your own CPAN::MyConfig file into your C<~/.XCPANCONFIGNAMEX/>
04f8ad
 directory so that you can save your own preferences instead of the
04f8ad
 system-wide ones.
04f8ad
 
04f8ad
@@ -2034,7 +2034,7 @@ in a file CPAN/Config.pm.
04f8ad
 
04f8ad
 Default values defined in the CPAN/Config.pm file can be
04f8ad
 overridden in a user specific file: CPAN/MyConfig.pm. Such a file is
04f8ad
-best placed in C<$HOME/.cpan/CPAN/MyConfig.pm>, because C<$HOME/.cpan> is
04f8ad
+best placed in C<$HOME/.XCPANCONFIGNAMEX/CPAN/MyConfig.pm>, because C<$HOME/.XCPANCONFIGNAMEX> is
04f8ad
 added to the search path of the CPAN module before the use() or
04f8ad
 require() statements. The mkmyconfig command writes this file for you.
04f8ad
 
04f8ad
@@ -3729,8 +3729,8 @@ there is too much output to keep track of.
04f8ad
 
04f8ad
 You may want to configure something like
04f8ad
 
04f8ad
-  o conf make_arg "| tee -ai /root/.cpan/logs/make.out"
04f8ad
-  o conf make_install_arg "| tee -ai /root/.cpan/logs/make_install.out"
04f8ad
+  o conf make_arg "| tee -ai /root/.XCPANCONFIGNAMEX/logs/make.out"
04f8ad
+  o conf make_install_arg "| tee -ai /root/.XCPANCONFIGNAMEX/logs/make_install.out"
04f8ad
 
04f8ad
 so that STDOUT is captured in a file for later inspection.
04f8ad
 
04f8ad
diff --git a/lib/CPAN/HandleConfig.pm b/lib/CPAN/HandleConfig.pm
04f8ad
index c72439f..a6b92e8 100644
04f8ad
--- a/lib/CPAN/HandleConfig.pm
04f8ad
+++ b/lib/CPAN/HandleConfig.pm
04f8ad
@@ -538,7 +538,7 @@ sub cpan_home_dir_candidates {
04f8ad
     push @dirs, $ENV{USERPROFILE} if $ENV{USERPROFILE};
04f8ad
 
04f8ad
     $CPAN::Config->{load_module_verbosity} = $old_v;
04f8ad
-    my $dotcpan = $^O eq 'VMS' ? '_cpan' : '.cpan';
04f8ad
+    my $dotcpan = $^O eq 'VMS' ? '_XCPANCONFIGNAMEX' : '.XCPANCONFIGNAMEX';
04f8ad
     @dirs = map { File::Spec->catdir($_, $dotcpan) } grep { defined } @dirs;
04f8ad
     return wantarray ? @dirs : $dirs[0];
04f8ad
 }
04f8ad
diff --git a/scripts/cpan-mirrors b/scripts/cpan-mirrors
04f8ad
index fe0e29c..493c140 100644
04f8ad
--- a/scripts/cpan-mirrors
04f8ad
+++ b/scripts/cpan-mirrors
04f8ad
@@ -143,7 +143,7 @@ to your configuration.
04f8ad
 
04f8ad
 If you don't have a F<MIRRORED.BY> file, this program will download one
04f8ad
 for you. It looks through your existing C<urllist> configuration and
04f8ad
-then default locations. It stores it in C<~/.cpan> (or your configured
04f8ad
+then default locations. It stores it in C<~/.XCPANCONFIGNAMEX> (or your configured
04f8ad
 location to store files).
04f8ad
 
04f8ad
 =head1 TO DO
04f8ad
-- 
04f8ad
2.13.6
04f8ad