| 1 | package ORDB::DebianModules::Generator; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Debian::ModuleList; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use DBI; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | our $VERSION = '0.02'; | |||||||||
| 7 | |||||||||||
| 8 | 0 | ▶ | sub save { | ||||||||
|
Subroutine
save: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 9 | 0 | my $file = shift; | |||||||||
| 10 | 0 | my @list = Debian::ModuleList::list_modules(); | |||||||||
| 11 | 0 | ▶ | unlink($file) if(-f $file); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | my $dbh = DBI->connect("dbi:SQLite:dbname=" . $file,"",""); | |||||||||
| 13 | 0 | $dbh->do("CREATE TABLE debian_module ( module TEXT NOT NULL PRIMARY KEY );"); | |||||||||
| 14 | 0 | $sth = $dbh->prepare("INSERT INTO debian_module (module) VALUES (?);"); | |||||||||
| 15 | 0 | $sth->execute($_) foreach(@list); | |||||||||
| 16 | 0 | $sth->finish(); | |||||||||
| 17 | 0 | $dbh->do("CREATE INDEX debian_module__module on debian_module ( module );"); | |||||||||
| 18 | 0 | $dbh->disconnect; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | =head1 NAME | ||||||||||
| 22 | |||||||||||
| 23 | ORDB::DebianModules::Generator - generator for the database ORDB::DebianModules points to | ||||||||||
| 24 | |||||||||||
| 25 | =cut | ||||||||||
| 26 | |||||||||||
| 27 | 1 | 1; | |||||||||