]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cdrom.cc
merge with lp:~mvo/apt/debian-sid
[apt.git] / apt-pkg / cdrom.cc
index b8f94e5b024dd64308b0daba46ab68abe33692c5..891c59836b411dca16c44579f99e4b1297336153 100644 (file)
@@ -160,7 +160,7 @@ bool pkgCdrom::FindPackages(string CD,
    
    return !_error->PendingError();
 }
-
+                                                                       /*}}}*/
 // Score - We compute a 'score' for a path                             /*{{{*/
 // ---------------------------------------------------------------------
 /* Paths are scored based on how close they come to what I consider
@@ -210,7 +210,6 @@ int pkgCdrom::Score(string Path)
 
    return Res;
 }
-
                                                                        /*}}}*/
 // DropBinaryArch - Dump dirs with a string like /binary-<foo>/                /*{{{*/
 // ---------------------------------------------------------------------
@@ -248,8 +247,7 @@ bool pkgCdrom::DropBinaryArch(vector<string> &List)
    
    return true;
 }
-
-
+                                                                       /*}}}*/
 // DropRepeats - Drop repeated files resulting from symlinks           /*{{{*/
 // ---------------------------------------------------------------------
 /* Here we go and stat every file that we found and strip dup inodes. */
@@ -304,7 +302,6 @@ bool pkgCdrom::DropRepeats(vector<string> &List,const char *Name)
    return true;
 }
                                                                        /*}}}*/
-
 // ReduceSourceList - Takes the path list and reduces it               /*{{{*/
 // ---------------------------------------------------------------------
 /* This takes the list of source list expressed entires and collects
@@ -513,9 +510,8 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
    
    return true;
 }
-
-
-bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
+                                                                       /*}}}*/
+bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)               /*{{{*/
 {
    stringstream msg;
 
@@ -560,15 +556,21 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
    }
    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());
    }
-   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;
 
@@ -668,8 +670,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    DropRepeats(TransList,"");
    if(log) {
       msg.str("");
-      ioprintf(msg, _("Found %u package indexes, %u source indexes, "
-                     "%u translation indexes and %u 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);
@@ -837,3 +839,4 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
 
    return true;
 }
+                                                                       /*}}}*/