Browse Source

Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into debian/sid

Michael Vogt 12 years ago
parent
commit
2af2eb53e8
1 changed files with 4 additions and 14 deletions
  1. 4 14
      ftparchive/cachedb.cc

+ 4 - 14
ftparchive/cachedb.cc

@@ -97,13 +97,8 @@ bool CacheDB::ReadyDB(std::string const &DB)
 /* */
 bool CacheDB::OpenFile()
 {
-   // its open already
-   if(Fd && Fd->Name() == this->FileName)
-      return true;
-
-   // a different file is open, close it first
-   if(Fd && Fd->Name() != this->FileName)
-      CloseFile();
+   // always close existing file first
+   CloseFile();
 
    // open a new file
    Fd = new FileFd(FileName,FileFd::ReadOnly);
@@ -128,13 +123,8 @@ void CacheDB::CloseFile()
 // CacheDB::OpenDebFile - Open a debfile				/*{{{*/
 bool CacheDB::OpenDebFile()
 {
-   // debfile is already open
-   if(DebFile && &DebFile->GetFile() == Fd)
-      return true;
-
-   // a different debfile is open, close it first
-   if(DebFile && &DebFile->GetFile() != Fd)
-      CloseDebFile();
+   // always close existing file first
+   CloseDebFile();
 
    // first open the fd, then pass it to the debDebFile
    if(OpenFile() == false)