- my $transactlog = db_transactlog();
- if (!open( LOG, ">>$transactlog" )) {
- warn "Can't open log file $transactlog: $!\n";
- return;
- }
- print LOG "$curr_date: $str\n";
- close( LOG );
+ $dbh->do('INSERT INTO ' . transactions_table_name() .
+ ' (package, distribution, version, action, ' .
+ ' prevstate, state, real_user, set_user, time) ' .
+ ' values (?, ?, ?, ?, ?, ?, ?, ?, ?)',
+ undef, $pkg->{'package'}, $distribution,
+ $pkg->{'version'}, $action, $prevstate, $pkg->{'state'},
+ $real_user, $user, 'now()') or die $dbh->errstr;