blib/lib/DBD/getsqlite.pl untested

filter: Statementstmt 0.0% 0 / 37 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 51 SCAR 17.9
CC
2
Cov
0%
xsystem
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.0
1 use strict;
2 use LWP::Simple qw(getstore);
3 use Fatal qw(chdir);
4 use ExtUtils::Command;
5  
6 my $version = shift || die "Usage: getsqlite.pl <version>\n";
7  
8 print("downloading http://www.sqlite.org/sqlite-$version.tar.gz\n");
9 if (getstore(
10 "http://www.sqlite.org/sqlite-$version.tar.gz",
11 "sqlite.tar.gz") != 200) {
12 die "Failed to download";
13 }
14 print("done\n");
15  
16 rm_rf('sqlite');
17 xsystem("tar zxvf sqlite.tar.gz");
18 chdir("sqlite");
19 xsystem("sh configure --enable-utf8");
20 xsystem("make parse.c sqlite.h opcodes.h opcodes.c");
21  
22 my %skip = map { $_ => 1 } map { chomp; $_ } <DATA>;
23 warn("Skip: $_\n") for keys %skip;
24  
25 foreach (<*.[ch]>, `find src -name \\*.[ch]`) {
26 chomp;
27 next if $skip{$_};
28 xsystem("cp $_ ../");
29 }
30  
31 exit(0);
32  
33 sub xsystem {
34 local $, = ", ";
35 print("@_\n");
36 my $ret = system(@_);
37 if ($ret != 0) {
38 die "system(@_) failed: $?";
39 }
40 }
41  
42 __DATA__