# Fix for RT45555: use local patches relative to prefs_dir
# 
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####

#### Patch data follows ####
diff -urp --binary "CPAN-1.9304\lib\CPAN.pm" "CPAN-1.9304-RT45555\lib\CPAN.pm"
Index: ./lib/CPAN.pm
--- ./lib/CPAN.pm	Sat Feb 28 17:33:39 2009
+++ ./lib/CPAN.pm	Wed Apr 29 15:34:12 2009
@@ -6877,7 +6877,10 @@ sub try_download {
             $CPAN::Frontend->myprint("Going to apply $countedpatches:\n");
             for my $patch (@$patches) {
                 unless (-f $patch) {
-                    if (my $trydl = $self->try_download($patch)) {
+					my $local_patch = File::Spec->rel2abs($patch, $CPAN::Config->{prefs_dir});
+					if (-f $local_patch) {
+						$patch = $local_patch;
+					} elsif (my $trydl = $self->try_download($patch)) {
                         $patch = $trydl;
                     } else {
                         my $fail = "Could not find patch '$patch'";
#### End of Patch data ####

#### ApplyPatch data follows ####
# Data version        : 1.0
# Date generated      : Wed Apr 29 15:37:08 2009
# Generated by        : makepatch 2.03
# Recurse directories : Yes
# Excluded files      : (\A|/).*\~\Z
#                       (\A|/).*\.a\Z
#                       (\A|/).*\.bak\Z
#                       (\A|/).*\.BAK\Z
#                       (\A|/).*\.elc\Z
#                       (\A|/).*\.exe\Z
#                       (\A|/).*\.gz\Z
#                       (\A|/).*\.ln\Z
#                       (\A|/).*\.o\Z
#                       (\A|/).*\.obj\Z
#                       (\A|/).*\.olb\Z
#                       (\A|/).*\.old\Z
#                       (\A|/).*\.orig\Z
#                       (\A|/).*\.rej\Z
#                       (\A|/).*\.so\Z
#                       (\A|/).*\.Z\Z
#                       (\A|/)\.del\-.*\Z
#                       (\A|/)\.make\.state\Z
#                       (\A|/)\.nse_depinfo\Z
#                       (\A|/)core\Z
#                       (\A|/)tags\Z
#                       (\A|/)TAGS\Z
# p "lib/CPAN.pm" 464312 1241012052 0100666
#### End of ApplyPatch data ####

#### End of Patch kit [created: Wed Apr 29 15:37:08 2009] ####
#### Patch checksum: 50 2041 57244 ####
#### Checksum: 68 2721 48237 ####