X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/408a4726131e9db26ff868623a5d216a26c45a50..ef1dff93202fa61e0b8cda761906bbca31e217bc:/apt-pkg/cdrom.cc?ds=inline diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index afa99bc73..891c59836 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -1,9 +1,6 @@ /* */ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/cdrom.h" -#endif #include #include #include @@ -163,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 @@ -213,7 +210,6 @@ int pkgCdrom::Score(string Path) return Res; } - /*}}}*/ // DropBinaryArch - Dump dirs with a string like /binary-/ /*{{{*/ // --------------------------------------------------------------------- @@ -251,8 +247,7 @@ bool pkgCdrom::DropBinaryArch(vector &List) return true; } - - + /*}}}*/ // 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 &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 @@ -516,9 +510,8 @@ bool pkgCdrom::WriteSourceList(string Name,vector &List,bool Source) return true; } - - -bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) + /*}}}*/ +bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ { stringstream msg; @@ -563,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; @@ -671,8 +670,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) 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); @@ -840,3 +839,4 @@ bool pkgCdrom::Add(pkgCdromStatus *log) return true; } + /*}}}*/