1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00
DBD-SQLite-SQLcipher/util/getsqlite.pl
Adam Kennedy 02603227e7 Corrected RT path.
Moved getsqlite.pl into util
2009-04-22 01:50:50 +00:00

32 lines
773 B
Perl

use strict;
use LWP::Simple qw(getstore);
use ExtUtils::Command;
my $version = shift || die "Usage: getsqlite.pl <version>\n";
print("downloading http://www.sqlite.org/sqlite-amalgamation-$version.tar.gz\n");
if (getstore(
"http://www.sqlite.org/sqlite-amalgamation-$version.tar.gz",
"sqlite.tar.gz") != 200) {
die "Failed to download";
}
print("done\n");
rm_rf('sqlite') || rm_rf("sqlite-$version");
xsystem("tar zxvf sqlite.tar.gz");
chdir("sqlite") || chdir("sqlite-$version") || die "SQLite directory not found";
xsystem("cp sqlite3.c ../");
xsystem("cp sqlite3.h ../");
xsystem("cp sqlite3ext.h ../");
exit(0);
sub xsystem {
local $, = ", ";
print("@_\n");
my $ret = system(@_);
if ($ret != 0) {
die "system(@_) failed: $?";
}
}