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