소스 검색

try defaults if auto-detection failed in apt-cdrom

The default is to ask udev for location and mountpoints of CD-ROMs,
but the old way of specifying the mountpoint is still available and
is tried now in case udev doesn't find any CD-ROM.

It probably fails, too, but we get a bunch of error messages this
way and the user can get an idea of how to make his setup work even
if udev can't be convienced to return something useful.

Closes: #712433
David Kalnischkies 13 년 전
부모
커밋
2ecf54d870
2개의 변경된 파일5개의 추가작업 그리고 9개의 파일을 삭제
  1. 4 9
      cmdline/apt-cdrom.cc
  2. 1 0
      debian/changelog

+ 4 - 9
cmdline/apt-cdrom.cc

@@ -150,14 +150,12 @@ bool DoAdd(CommandLine &)
    bool res = true;
 
    bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
+   unsigned int count = 0;
    if (AutoDetect && UdevCdroms.Dlopen())
-   {
-      unsigned int count = 0;
       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;
@@ -178,15 +176,12 @@ bool DoIdent(CommandLine &)
 
    bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
 
+   unsigned int count = 0;
    if (AutoDetect && UdevCdroms.Dlopen())
-   {
-      unsigned int count = 0;
       while (AutoDetectCdrom(UdevCdroms, count))
 	 res &= cdrom.Ident(ident, &log);
-   } else {
+   if (count == 0)
       return cdrom.Ident(ident, &log);
-   }
- 
    return res;
 }
 									/*}}}*/

+ 1 - 0
debian/changelog

@@ -17,6 +17,7 @@ apt (0.9.8.3) UNRELEASED; urgency=low
   * ensure state-dir exists before coyping cdrom files
   * fix file location for configure-index.gz in apt.conf(5) (Closes: #711921)
   * handle missing "Description" in apt-cache show (Closes: #712435)
+  * try defaults if auto-detection failed in apt-cdrom (Closes: #712433)
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 09 Jun 2013 15:06:24 +0200