* Removed the more leftover #pragma interface/implementation
[ntk/apt.git] / apt-pkg / deb / debindexfile.cc
index b57493b..ed76338 100644 (file)
@@ -9,10 +9,6 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/debindexfile.h"
-#endif
-
 #include <apt-pkg/debindexfile.h>
 #include <apt-pkg/debsrcrecords.h>
 #include <apt-pkg/deblistparser.h>
@@ -24,7 +20,7 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/debmetaindex.h>
-    
+
 #include <sys/stat.h>
                                                                        /*}}}*/
 
@@ -290,7 +286,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const
       FileFd Rel(ReleaseFile,FileFd::ReadOnly);
       if (_error->PendingError() == true)
         return false;
-      Parser.LoadReleaseInfo(File,Rel);
+      Parser.LoadReleaseInfo(File,Rel,Section);
    }
    
    return true;
@@ -305,7 +301,7 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const
    pkgCache::PkgFileIterator File = Cache.FileBegin();
    for (; File.end() == false; File++)
    {
-      if (FileName != File.FileName())
+       if (File.FileName() == NULL || FileName != File.FileName())
         continue;
       
       struct stat St;
@@ -358,7 +354,7 @@ string debTranslationsIndex::IndexURI(const char *Type) const
 /* */
 bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const
 {
-   if (UseTranslation()) {
+   if (TranslationsAvailable()) {
      string TranslationFile = "Translation-" + LanguageCode();
      new pkgAcqIndexTrans(Owner, IndexURI(LanguageCode().c_str()),
                          Info(TranslationFile.c_str()),
@@ -401,6 +397,14 @@ string debTranslationsIndex::Info(const char *Type) const
    return Info;
 }
                                                                        /*}}}*/
+bool debTranslationsIndex::HasPackages() const
+{
+   if(!TranslationsAvailable())
+      return false;
+   
+   return FileExists(IndexFile(LanguageCode().c_str()));
+}
+
 // TranslationsIndex::Exists - Check if the index is available         /*{{{*/
 // ---------------------------------------------------------------------
 /* */
@@ -427,7 +431,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const
 {
    // Check the translation file, if in use
    string TranslationFile = IndexFile(LanguageCode().c_str());
-   if (UseTranslation() && FileExists(TranslationFile))
+   if (TranslationsAvailable() && FileExists(TranslationFile))
    {
      FileFd Trans(TranslationFile,FileFd::ReadOnly);
      debListParser TransParser(&Trans);