Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 45555
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.93_52
Fixed in: (no value)



Subject: [PATCH] distroprefs: use local patches relative to prefs_dir
Currently patches path given in distroprefs are either searched locally in the distribution (which means probably never as patches are ) or on CPAN. Requiring the patch to be published on CPAN is painful as a published patch is not immediately available on the mirrors. It would be more useful if the patch files would be searched first on the local filesystem in using the prefs_dir as the base path if the path is relative. Patch is coming.
Here is the patch.
# 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 ####
Please have a look at 1.93_52, it supports a patch_dir config variable. I think this would be what you were looking for, right?
Le Mer. Avr. 29 19:41:16 2009, ANDK a écrit : Show quoted text
> Please have a look at 1.93_52, it supports a patch_dir config variable. > I think this would be what you were looking for, right?
Yes "patches_dir" is an answer. But my solution has the advantage of not requiring a new setting. Having to reconfigure CPAN when upgrading it is painful. Particularly because in newer CPAN releases the unkwown settings are not saved. So I can not set patches_dir if my CPAN.pm is older than 1.93_52.