Permalink
Browse files

several robustness improvements

  • Loading branch information...
1 parent 66258ba commit c95de60256990ec6432ee9edcbd00ee2a7780083 @moritz moritz committed Oct 20, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 web/build-project-list.pl
  2. +2 −1 web/lib/P6Project.pm
  3. +5 −0 web/lib/P6Project/Info.pm
@@ -21,7 +21,7 @@
my $template = './index.tmpl';
-make_path($output_dir, { mode => 0755 }) unless -e "$output_dir/logos";
+make_path("$output_dir/logos", { mode => 0755 }) unless -e "$output_dir/logos";
my $p6p = P6Project->new(output_dir=>$output_dir, min_popular=>$min_popular, template=>$template);
View
@@ -47,7 +47,8 @@ sub getstore {
my ($self, $url, $filename) = @_;
my $file = $self->ua->get($url);
if (!$file->success) { return 0; }
- open my $f, '>', $self->output_dir . $filename or die "Cannot open '$filename' for writing: $!";
+ my $path = $self->output_dir . $filename;
+ open my $f, '>', $path or die "Cannot open '$path' for writing: $!";
print { $f } $file->res->body;
close $f or warn "Error while closing file '$filename': $!";
return 1;
@@ -37,8 +37,13 @@ sub get_projects {
next;
}
my $name = $json->{'name'};
+ unless (defined $name) {
+ warn "$proj has no name, skipping!\n";
+ next;
+ }
my $url = $json->{'source-url'} // $json->{'repo-url'};
$projects->{$name}->{'url'} = $url;
+ $projects->{$name}{success} = 0;
my ($home) = $url =~ m[git://([\w\.]+)/];
if ($home) {
given ($home) {

0 comments on commit c95de60

Please sign in to comment.