#!/usr/bin/perl
# UCW Gallery -- Master Program
-# (c) 2012 Martin Mares <mj@ucw.cz>
+# (c) 2012--2015 Martin Mares <mj@ucw.cz>
-use strict;
-use warnings;
+use common::sense;
use Getopt::Long;
use FindBin;
GetOptions(
"help" => \&show_help,
"version" => sub {
- print "UCW Gallery 2.0 (c) 2004-2012 Martin Mares <mj\@ucw.cz>\n";
+ print "UCW Gallery 2.1 (c) 2004-2015 Martin Mares <mj\@ucw.cz>\n";
},
"all!" => \$all,
"p|parallel=i" => \$parallel,
-x $sub_path or die "Unknown subcommand $sub\n";
$ENV{"GALLERY_ROOT"} = $gallery_root;
-$ENV{"PERL5LIB"} = join(":", $gallery_root, $ENV{"PERL5LIB"} // ());
+$ENV{"PERL5LIB"} = join(":", $gallery_root . "/lib", $ENV{"PERL5LIB"} // ());
if (!$all) {
exec $sub_path, @ARGV;
if (!$pid) {
if ($logging) {
close STDOUT;
- open STDOUT, '>', "$dir/gallery.log" or die;
+ open STDOUT, '>', "$dir/gallery.log" or die "Unable to create $dir/gallery.log: $!\n";
close STDERR;
open STDERR, '>&STDOUT';
}