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