User:AnomieBOT/source/tasks/SourceUploader.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: SourceUploader: * Create empty shutoff pages if they don't exist, after a discussion where someone was confused by the non-existent page.
AnomieBOT (talk | contribs)
Updating published sources: General: * BREAKING CHANGE: Split d::Util into several different modules. * Many tasks updated to use log/debug instead of warn. AnomieBOT::API: * Moved warn back into AnomieBOT::API. * New functions: log, debug, halting *
Line 67:
$basedir=~s{/$}{};
if(!-d $basedir){
$selfAnomieBOT::API->warn("Cannot find source directory\n");
return $self;
}
Line 73:
$self->{'summary'}='Updating published sources: ';
if(!open(X, "<", 'ChangeLog')){
$selfAnomieBOT::API->warn("Cannot load changelog\n");
return $self;
}
Line 101:
while(my $dir=shift @dirs){
if(!opendir(D, $dir)){
$selfAnomieBOT::API->warn("Cannot open directory $dir: $!\n");
return $self;
}
Line 124:
next if ($stat[2]&(S_IROTH))!=(S_IROTH);
if(!open(X, '<:utf8', $p)){
$selfAnomieBOT::API->warn("Cannot open file $p: $!\n");
return $self;
}
Line 212:
$img='Gnome-fs-regular.svg';
} else {
$selfAnomieBOT::API->warn("Unusual filetype on $p\n");
}
my $sz=$stat[7];
Line 258:
my @shutoff=@{$self->{'shutoff_pages'}};
if(!@keys && !@shutoff && !exists($self->{'tasklist'})){
$self->warndebug(2, "TerminatingSource uploaded, task\nterminating");
return undef;
}
 
$api->task('SourceUploader', 0, 10, qw/d::Util/());
 
my $src='User:'.$api->user.'/source';
Line 328:
return 60;
} else {
$api->warnlog("Created $page\n");
}
}
Line 360:
return 60;
} else {
$api->warnlog("Updated $page\n");
}
} else {
$api->warndebug(2, "No update needed for $page\n");
}
return 0;