OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-registry Date: 03-Aug-2006 02:13:26
Branch: HEAD Handle: 2006080301132600
Modified files:
openpkg-registry registry-db.pl
Log:
erase session database by truncating the dbfile; session database must
be built in small steps
Summary:
Revision Changes Path
1.48 +12 -7 openpkg-registry/registry-db.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-registry/registry-db.pl
============================================================================
$ cvs diff -u -r1.47 -r1.48 registry-db.pl
--- openpkg-registry/registry-db.pl 3 Aug 2006 00:11:49 -0000 1.47
+++ openpkg-registry/registry-db.pl 3 Aug 2006 00:13:26 -0000 1.48
@@ -433,6 +433,10 @@
$cfg->{db}->{registry}->{username};
&dbdo($dbh, $sql,
'(user|role) .* does not exist') || die;
+
+ my $dbfile = $cfg->{db}->{session}->{dbfile};
+ &debug("truncate session database dbfile=\"$dbfile\"");
+ truncate $dbfile, 0;
}
sub setup ()
@@ -493,6 +497,7 @@
die "ERROR:$0: DataBase error: ".$DBI::errstr."\n" if (not defined $dbh);
while (&upgraderegistry()) {};
$dbh->disconnect(); undef $dbh;
+
}
sub upgradesession()
@@ -537,10 +542,11 @@
elsif ( $dbv->{version}->{major} == 0
and $dbv->{version}->{minor} == 0
and $dbv->{version}->{patch} == 0) {
- $sql = "";
- $sql .= &schemasession1();
- $sql .= &schemasession2();
- $sql .= "INSERT INTO config VALUES ( 'version', '0.0.1' );";
+ $sql = &schemasession1();
+ &dbdo($dbh, $sql) || die;
+ $sql = &schemasession2();
+ &dbdo($dbh, $sql) || die;
+ $sql = "INSERT INTO config VALUES ( 'version', '0.0.1' );";
&dbdo($dbh, $sql) || die;
return 1;
}
@@ -550,8 +556,8 @@
elsif ( $dbv->{version}->{major} == 0
and $dbv->{version}->{minor} == 0
and $dbv->{version}->{patch} < 24 ) {
- $sql = "";
- $sql .= &schemasession3();
+ $sql = &schemasession3();
+ &dbdo($dbh, $sql) || die;
$sql = "UPDATE config SET value = '0.0.24' WHERE ( key = 'version'
);";
&dbdo($dbh, $sql) || die;
return 1;
@@ -561,7 +567,6 @@
#
elsif ( $dbv->{version}->{major} == 0
and $dbv->{version}->{minor} < 6 ) {
- $sql = "";
$sql = "UPDATE config SET value = '0.6.0' WHERE ( key = 'version'
);";
&dbdo($dbh, $sql) || die;
return 1;
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]