]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cdrom.cc
eliminate (hopefully all) segfaults in pkgcachegen.cc and mmap.cc
[apt.git] / apt-pkg / cdrom.cc
index afa99bc7332008573603aeafe82918ec1ea10576..891c59836b411dca16c44579f99e4b1297336153 100644 (file)
@@ -1,9 +1,6 @@
 /*
  */
 
 /*
  */
 
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/cdrom.h"
-#endif
 #include<apt-pkg/init.h>
 #include<apt-pkg/error.h>
 #include<apt-pkg/cdromutl.h>
 #include<apt-pkg/init.h>
 #include<apt-pkg/error.h>
 #include<apt-pkg/cdromutl.h>
@@ -163,7 +160,7 @@ bool pkgCdrom::FindPackages(string CD,
    
    return !_error->PendingError();
 }
    
    return !_error->PendingError();
 }
-
+                                                                       /*}}}*/
 // Score - We compute a 'score' for a path                             /*{{{*/
 // ---------------------------------------------------------------------
 /* Paths are scored based on how close they come to what I consider
 // Score - We compute a 'score' for a path                             /*{{{*/
 // ---------------------------------------------------------------------
 /* Paths are scored based on how close they come to what I consider
@@ -213,7 +210,6 @@ int pkgCdrom::Score(string Path)
 
    return Res;
 }
 
    return Res;
 }
-
                                                                        /*}}}*/
 // DropBinaryArch - Dump dirs with a string like /binary-<foo>/                /*{{{*/
 // ---------------------------------------------------------------------
                                                                        /*}}}*/
 // DropBinaryArch - Dump dirs with a string like /binary-<foo>/                /*{{{*/
 // ---------------------------------------------------------------------
@@ -251,8 +247,7 @@ bool pkgCdrom::DropBinaryArch(vector<string> &List)
    
    return true;
 }
    
    return true;
 }
-
-
+                                                                       /*}}}*/
 // DropRepeats - Drop repeated files resulting from symlinks           /*{{{*/
 // ---------------------------------------------------------------------
 /* Here we go and stat every file that we found and strip dup inodes. */
 // DropRepeats - Drop repeated files resulting from symlinks           /*{{{*/
 // ---------------------------------------------------------------------
 /* Here we go and stat every file that we found and strip dup inodes. */
@@ -307,7 +302,6 @@ bool pkgCdrom::DropRepeats(vector<string> &List,const char *Name)
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
-
 // ReduceSourceList - Takes the path list and reduces it               /*{{{*/
 // ---------------------------------------------------------------------
 /* This takes the list of source list expressed entires and collects
 // ReduceSourceList - Takes the path list and reduces it               /*{{{*/
 // ---------------------------------------------------------------------
 /* This takes the list of source list expressed entires and collects
@@ -516,9 +510,8 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
    
    return true;
 }
    
    return true;
 }
-
-
-bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
+                                                                       /*}}}*/
+bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)               /*{{{*/
 {
    stringstream msg;
 
 {
    stringstream msg;
 
@@ -563,15 +556,21 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
    }
    if(log) {
       msg.str("");
    }
    if(log) {
       msg.str("");
-      ioprintf(msg, _("Stored label: %s \n"),
-              Database.Find("CD::"+ident).c_str());
+      ioprintf(msg, _("Stored label: %s\n"),
+      Database.Find("CD::"+ident).c_str());
       log->Update(msg.str());
    }
       log->Update(msg.str());
    }
-   return true;
-}
 
 
+   // Unmount and finish
+   if (_config->FindB("APT::CDROM::NoMount",false) == false) {
+      log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST);
+      UnmountCdrom(CDROM);
+   }
 
 
-bool pkgCdrom::Add(pkgCdromStatus *log)
+   return true;
+}
+                                                                       /*}}}*/
+bool pkgCdrom::Add(pkgCdromStatus *log)                                        /*{{{*/
 {
    stringstream msg;
 
 {
    stringstream msg;
 
@@ -671,8 +670,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    DropRepeats(TransList,"");
    if(log) {
       msg.str("");
    DropRepeats(TransList,"");
    if(log) {
       msg.str("");
-      ioprintf(msg, _("Found %i package indexes, %i source indexes, "
-                     "%i translation indexes and %i signatures\n"), 
+      ioprintf(msg, _("Found %zu package indexes, %zu source indexes, "
+                     "%zu translation indexes and %zu signatures\n"), 
               List.size(), SourceList.size(), TransList.size(),
               SigList.size());
       log->Update(msg.str(), STEP_SCAN);
               List.size(), SourceList.size(), TransList.size(),
               SigList.size());
       log->Update(msg.str(), STEP_SCAN);
@@ -840,3 +839,4 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
 
    return true;
 }
 
    return true;
 }
+                                                                       /*}}}*/