diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-06-16 18:28:45 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2013-06-20 10:46:32 +0200 |
commit | 2ecf54d8704f93f086df7def08e80f49892ac075 (patch) | |
tree | 2fe3b60610a84ac44adfd47fd3c33fa8813260cf /cmdline/apt-cdrom.cc | |
parent | 99359751efb1ad84e877219639030feb47fb28f7 (diff) | |
download | apt-2ecf54d8704f93f086df7def08e80f49892ac075.tar.gz |
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
Diffstat (limited to 'cmdline/apt-cdrom.cc')
-rw-r--r-- | cmdline/apt-cdrom.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 2551f4916..70e49910c 100644 --- a/cmdline/apt-cdrom.cc +++ b/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; } /*}}}*/ |