]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cdrom.cc
fix SHA2* cleanups to zero-out the complete context
[apt.git] / cmdline / apt-cdrom.cc
index d1268edf9a239358db91d9d9746667fa159c8ef5..70e49910c48dae6494f660bf0987bdd5c75ffbd7 100644 (file)
@@ -11,6 +11,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include<config.h>
+
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/cdrom.h>
-#include <config.h>
-#include <apti18n.h>
-    
-//#include "indexcopy.h"
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <locale.h>
 #include <iostream>
@@ -36,6 +36,8 @@
 #include <dirent.h>
 #include <unistd.h>
 #include <stdio.h>
+
+#include <apti18n.h>
                                                                        /*}}}*/
 
 using namespace std;
@@ -149,14 +151,11 @@ bool DoAdd(CommandLine &)
 
    bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
    unsigned int count = 0;
-   
    if (AutoDetect && UdevCdroms.Dlopen())
-   {
       while (AutoDetectCdrom(UdevCdroms, count))
         res &= cdrom.Add(&log);
-   } else {
+   if (count == 0)
       res = cdrom.Add(&log);
-   }
 
    if(res)
       cout << _("Repeat this process for the rest of the CDs in your set.") << endl;
@@ -176,16 +175,13 @@ bool DoIdent(CommandLine &)
    bool res = true;
 
    bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
+
    unsigned int count = 0;
-   
    if (AutoDetect && UdevCdroms.Dlopen())
-   {
       while (AutoDetectCdrom(UdevCdroms, count))
         res &= cdrom.Ident(ident, &log);
-   } else {
+   if (count == 0)
       return cdrom.Ident(ident, &log);
-   }
    return res;
 }
                                                                        /*}}}*/
@@ -194,7 +190,7 @@ bool DoIdent(CommandLine &)
 /* */
 int ShowHelp()
 {
-   ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION,
+   ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
            COMMON_ARCH,__DATE__,__TIME__);
    if (_config->FindB("version") == true)
       return 0;