App-MBUtiny
view release on metacpan or search on metacpan
lib/App/MBUtiny/Collector/DBI.pm view on Meta::CPAN
);
my $dbh = $db->connect if $db;
# SQLite
my $fnew = 0;
my $issqlite = 0;
if ($dbh && $dsn =~ /SQLite/i) {
$file = $dbh->sqlite_db_filename();
unless ($file && (-e $file) && !(-z $file)) {
touch($file);
chmod(0666, $file);
$fnew = 1;
}
$issqlite = 1;
}
my $error = "";
if (!$db) {
$error = sprintf("Can't init database \"%s\"", $dsn);
} elsif (!$dbh) {
$error = sprintf("Can't connect to database \"%s\": %s", $dsn, $DBI::errstr || "unknown error");
lib/App/MBUtiny/Util.pm view on Meta::CPAN
return 1;
} elsif (@exd && grep {_td($_,$f)} @exd) {
print ">D [SKIP] $f\n" if $DEBUG;
return 1;
} else {
if (-d $f) {
my $end = File::Spec->catdir($tg, $p);
print ">D $f -> $end\n" if $DEBUG;
unless (-e $end) {
mkdir($end,DIRMODE) or carp(sprintf("Can't create directoy \"%s\": ", $end, $!)) && return;
chmod scalar((stat($f))[2]), $end;
}
} else {
my $end = File::Spec->catfile($tg, $p);
print ">F $f -> $end\n" if $DEBUG;
unless (-e $end) {
copy($f,$end) or carp(sprintf("Copy failed \"%s\" -> \"%s\": %s", $f, $end, $!)) && return;
chmod scalar((stat($f))[2]), $end;
}
}
}
},
no_chdir => 1,
}, $ob,
);
print "\n" if $DEBUG;
return 1;
( run in 0.389 second using v1.01-cache-2.11-cpan-496ff517765 )