]> git.saurik.com Git - apt.git/blobdiff - apt-inst/deb/dpkgdb.cc
apt-pkg/contrib/netrc.cc: use a slightly smaller login/password size
[apt.git] / apt-inst / deb / dpkgdb.cc
index f71811a9b178af17ace8a1c84343df6b847d2682..819c123f67170cb61cda8181daf1b21ce40afc31 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: dpkgdb.cc,v 1.7 2003/02/10 00:36:12 doogie Exp $
+// $Id: dpkgdb.cc,v 1.7.2.1 2004/01/16 18:58:50 mdz Exp $
 /* ######################################################################
 
    DPKGv1 Database Implemenation
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/dpkgdb.h"
-#endif
+#include<config.h>
 
-#include <apti18n.h>
 #include <apt-pkg/dpkgdb.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/filelist.h>
 
 #include <stdio.h>
 #include <errno.h>
@@ -33,6 +32,7 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <iostream>
+#include <apti18n.h>
                                                                        /*}}}*/
 using namespace std;
 
@@ -61,13 +61,13 @@ static bool EraseDir(const char *Dir)
       return _error->Errno("rmdir",_("Failed to remove %s"),Dir);
    
    // Purge it using rm
-   int Pid = ExecFork();
+   pid_t Pid = ExecFork();
 
    // Spawn the subprocess
    if (Pid == 0)
    {
       execlp(_config->Find("Dir::Bin::rm","/bin/rm").c_str(),
-            "rm","-rf","--",Dir,0);
+            "rm","-rf","--",Dir,(char *)NULL);
       _exit(100);
    }
    return ExecWait(Pid,_config->Find("dir::bin::rm","/bin/rm").c_str());
@@ -136,7 +136,7 @@ bool debDpkgDB::ReadyPkgCache(OpProgress &Progress)
 {
    if (Cache != 0)
    {  
-      Progress.OverallProgress(1,1,1,_("Reading Package Lists"));      
+      Progress.OverallProgress(1,1,1,_("Reading package lists"));      
       return true;
    }
    
@@ -146,7 +146,7 @@ bool debDpkgDB::ReadyPkgCache(OpProgress &Progress)
       CacheMap = 0;
    }
    
-   if (pkgMakeOnlyStatusCache(Progress,&CacheMap) == false)
+   if (pkgCacheGenerator::MakeOnlyStatusCache(&Progress,&CacheMap) == false)
       return false;
    Cache->DropProgress();
    
@@ -198,11 +198,11 @@ bool debDpkgDB::ReadFList(OpProgress &Progress)
       pkgFLCache::PkgIterator FlPkg = FList->GetPkg(I.Name(),0,true);
       if (FlPkg.end() == true)
       {
-        _error->Error(_("Internal Error getting a Package Name"));
+        _error->Error(_("Internal error getting a package name"));
         break;
       }
       
-      Progress.OverallProgress(Count,Total,1,_("Reading File Listing"));
+      Progress.OverallProgress(Count,Total,1,_("Reading file listing"));
      
       // Open the list file
       snprintf(Name,sizeof(Name),"%s.list",I.Name());
@@ -263,7 +263,7 @@ bool debDpkgDB::ReadFList(OpProgress &Progress)
                                              FlPkg.Offset(),true,false);
            if (Node.end() == true)
            {
-              _error->Error(_("Internal Error getting a Node"));
+              _error->Error(_("Internal error getting a node"));
               break;
            }
         }
@@ -352,14 +352,14 @@ bool debDpkgDB::ReadDiversions()
       pkgFLCache::PkgIterator FlPkg = FList->GetPkg(Package,0,true);
       if (FlPkg.end() == true)
       {
-        _error->Error(_("Internal Error getting a Package Name"));
+        _error->Error(_("Internal error getting a package name"));
         break;
       }
       
       // Install the diversion
       if (FList->AddDiversion(FlPkg,From,To) == false)
       {
-        _error->Error(_("Internal Error adding a diversion"));
+        _error->Error(_("Internal error adding a diversion"));
         break;
       }
    }
@@ -380,10 +380,10 @@ bool debDpkgDB::ReadDiversions()
 bool debDpkgDB::ReadyFileList(OpProgress &Progress)
 {
    if (Cache == 0)
-      return _error->Error(_("The pkg cache must be initialize first"));
+      return _error->Error(_("The pkg cache must be initialized first"));
    if (FList != 0)
    {
-      Progress.OverallProgress(1,1,1,_("Reading File List"));
+      Progress.OverallProgress(1,1,1,_("Reading file listing"));
       return true;
    }
    
@@ -440,12 +440,12 @@ bool debDpkgDB::ReadConfFiles()
       const char *PkgStart;
       const char *PkgEnd;
       if (Section.Find("Package",PkgStart,PkgEnd) == false)
-        return _error->Error(_("Failed to find a Package: Header, offset %lu"),Offset);
+        return _error->Error(_("Failed to find a Package: header, offset %lu"),Offset);
 
       // Snag a package record for it
       pkgFLCache::PkgIterator FlPkg = FList->GetPkg(PkgStart,PkgEnd,true);
       if (FlPkg.end() == true)
-        return _error->Error(_("Internal Error getting a Package Name"));
+        return _error->Error(_("Internal error getting a package name"));
 
       // Parse the conf file lines
       while (1)