Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ee6cd30d70
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (29 sloc) 0.807 kb
name 'cp562an';
description 'Use CP5.6.2AN (or other similar) mirrors';
author 'Tatsuhiko Miyagawa';
api_version 0.1;
my $mirror_base = 'http://cp__WHAT__an.barnyard.co.uk/';
# TODO: maybe hook as a command?
hook search_module => sub {
my $args = shift;
my $what = detect_platform();
if ($what) {
my $mirror = $mirror_base;
$mirror =~ s/__WHAT__/$what/;
$args->{app}->chat("Using $mirror");
# TODO query the mirror
}
return;
};
sub detect_platform {
if ($] eq '5.008008') {
return '5.8.8';
} elsif ($] eq '5.008009') {
return '5.8.9';
} elsif ($] eq '5.006002') {
return '5.6.2';
}
my %p = map { $_ => 1 } qw( MSWin32 cygwin irix netbsd solaris );
return $^O if $p{$^O};
return;
}
Jump to Line
Something went wrong with that request. Please try again.