# todo: use $c instead?
my ($chan) = @_;
- if (!defined $chan or $chan =~ /^\s*$/ or $chan =~ /^_default$/) {
+ if (!defined $chan or $chan =~ /^\s*$/) {
return 0;
}
# it's possible that this check creates the hash if empty.
if (defined $channels{$chan} or exists $channels{$chan}) {
- if ($chan eq "_default") {
+ if ($chan =~ /^_?default$/) {
# &WARN("validC: chan cannot be _default! returning 0!");
return 0;
}
* 60 * 60 * 24;
my $debug = 0;
my $debian_dir = "$::bot_state_dir/debian";
+my $country = "ca";
my %dists = (
"unstable" => "sid",
my %urlcontents = (
"Contents-##DIST-i386.gz" =>
- "ftp://ftp.us.debian.org".
+ "ftp://ftp.$country.debian.org".
"/debian/dists/##DIST/Contents-i386.gz",
"Contents-##DIST-i386-non-US.gz" =>
"ftp://non-us.debian.org".
my %urlpackages = (
"Packages-##DIST-main-i386.gz" =>
- "ftp://ftp.us.debian.org".
+ "ftp://ftp.$country.debian.org".
"/debian/dists/##DIST/main/binary-i386/Packages.gz",
"Packages-##DIST-contrib-i386.gz" =>
- "ftp://ftp.us.debian.org".
+ "ftp://ftp.$country.debian.org".
"/debian/dists/##DIST/contrib/binary-i386/Packages.gz",
"Packages-##DIST-non-free-i386.gz" =>
- "ftp://ftp.us.debian.org".
+ "ftp://ftp.$country.debian.org".
"/debian/dists/##DIST/non-free/binary-i386/Packages.gz",
"Packages-##DIST-non-US-main-i386.gz" =>
}
my %stats;
- my %total;
+ my %total = (maint => 0, isize => 0, csize => 0);
my $file;
foreach $file (keys %urlpackages) {
$file =~ s/##DIST/$dist/g; # won't work for incoming.
"kB of memory."
);
- # todo: make dbGetColNiceHash().
+ # todo: use dbGetColNiceHash().
my %hash = &dbGetCol("stats", "nick,counter", "type='cmdstats'".
# " ORDER BY counter DESC LIMIT 3", 1);
" ORDER BY counter DESC", 1);
+if (0) {
foreach (keys %hash) {
my $i = $_;
foreach (keys %{ $hash{$i} }) {
}
}
&DEBUG("end of cmdstats.");
+}
return;
}