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