// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cachedb.cc,v 1.3 2001/05/29 03:50:33 jgg Exp $
+// $Id: cachedb.cc,v 1.6 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
CacheDB
#include "cachedb.h"
+#include <apti18n.h>
#include <apt-pkg/error.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/strutl.h>
corrupted DB */
if (DBFailed() == true)
{
- _error->Warning("DB was corrupted, file renamed to %s.old",DBFile.c_str());
+ _error->Warning(_("DB was corrupted, file renamed to %s.old"),DBFile.c_str());
rename(DBFile.c_str(),(DBFile+".old").c_str());
}
0644,0,0,&Dbp)) != 0)
{
Dbp = 0;
- return _error->Errno("db_open","Unable to open DB2 file %s",DB.c_str());
+ return _error->Errno("db_open",_("Unable to open DB2 file %s"),DB.c_str());
}
DBFile = DB;
// Lookup the stat info and confirm the file is unchanged
if (Get() == true)
{
- if (CurStat.st_mtime != htonl(St.st_mtime))
+ if (CurStat.mtime != htonl(St.st_mtime))
{
- CurStat.st_mtime = htonl(St.st_mtime);
+ CurStat.mtime = htonl(St.st_mtime);
CurStat.Flags = 0;
- _error->Warning("File date has changed %s",FileName.c_str());
+ _error->Warning(_("File date has changed %s"),FileName.c_str());
}
}
else
{
- CurStat.st_mtime = htonl(St.st_mtime);
+ CurStat.mtime = htonl(St.st_mtime);
CurStat.Flags = 0;
}
CurStat.Flags = ntohl(CurStat.Flags);
return false;
if (Control.Control == 0)
- return _error->Error("Archive has no control record");
+ return _error->Error(_("Archive has no control record"));
// Write back the control information
InitQuery("cl");
{
// Optimize away some writes.
if (CurStat.Flags == OldStat.Flags &&
- CurStat.st_mtime == OldStat.st_mtime)
+ CurStat.mtime == OldStat.mtime)
return true;
// Write the stat information
#if DB_VERSION_MAJOR >= 2 && DB_VERSION_MINOR >= 7
DBC *Cursor;
if ((errno = Dbp->cursor(Dbp,0,&Cursor,0)) != 0)
- return _error->Error("Unable to get a cursor");
+ return _error->Error(_("Unable to get a cursor"));
#else
DBC *Cursor;
if ((errno = Dbp->cursor(Dbp,0,&Cursor)) != 0)
- return _error->Error("Unable to get a cursor");
+ return _error->Error(_("Unable to get a cursor"));
#endif
DBT Key;