Subject: | Need option to cope with braindead proxy |
Date: | Fri, 8 Apr 2016 09:44:10 +0000 |
To: | "bug-CPAN [...] rt.cpan.org" <bug-CPAN [...] rt.cpan.org> |
From: | "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de> |
Hi,
i get the following message:
---- DAGOLDEN/CPAN-Reporter-1.2017.tar.gz ----
Config::Tiny [requires]
Running install for module 'Config::Tiny'
Checksum mismatch for distribution file. Please investigate.
Distribution id = R/RS/RSAVAGE/Config-Tiny-2.23.tgz
CPAN_USERID RSAVAGE (Ron Savage <ron@savage.net.au>)
CPAN_VERSION 2.23
CALLED_FOR Config::Tiny
CHECKSUM_STATUS
CONTAINSMODS Config::Tiny
UPLOAD_DATE 2015-10-13
incommandcolor 2
localfile C:\strawberry-5.22.1.2-32\cpan\sources\authors\id\R\RS\RSAVAGE\
Config-Tiny-2.23.tgz
mandatory 1
negative_prefs_cache 0
prefs HASH(0x3f1775c)
reqtype r
I'd recommend removing
C:\strawberry-5.22.1.2-32\cpan\sources\authors\id\R\RS\RSAVAGE\Config-Tiny-
2.23.tgz. Its
checksum is incorrect. Maybe you have configured your 'urllist' with
a bad URL. Please check this array with 'o conf urllist', and
retry.
Problem is, our braindead scanning proxy (required for obvious reasons by company policy) unpacks gzip files, C:\strawberry-5.22.1.2-32\cpan\sources\authors\id\R\RS\RSAVAGE\Config-Tiny-2.23.tgz is a tar file and not gzip-ed. Zip files and Bz2 files are transferred correctly, but the proxy seems to mix up zlib http compression and gz files. The proxy is maintained by our network provider and the contact persons at the provider don't even understand the problem (network experts at work...). I tried to re-gzip the unpacked tar with default settings, but this didn't work -- as expected.
To be able to install distributions that happen to come in tgz archives, i patched CPAN::Distribution in sub CHECKSUM_check_file:
} else {
$CPAN::Frontend->myprint(qq{\nChecksum mismatch for }.
qq{distribution file. }.
qq{Please investigate.\n\n}.
$self->as_string,
$CPAN::META->instance(
'CPAN::Author',
$self->cpan_userid
)->as_string);
# work around for braindead proxy
return $self->{CHECKSUM_STATUS} = "OK";
my $wrap = qq{I\'d recommend removing $file. Its
checksum is incorrect. Maybe you have configured your 'urllist' with
a bad URL. Please check this array with 'o conf urllist', and
retry.};
I wanted the checksum to be checked and the message to be printed, but the install process to continue normally, because i obviously want to install distributions, even if i have to rely on the file being magically untampered.
A technically better solution (apart from fixing the proxy, which is impossible in this case) would be to calculate the checksum for the _uncompressed_ tar archive or for the unpacked directory tree, but this would surely be overkill.
Is it possible to add an appropriately named configuration variable to enable my work around in an 'official' way?
Ralf