diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-03-10 13:22:56 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-03-10 13:22:56 +0100 |
commit | 60600564dbf7b48b237d776b514f271a1c091ffa (patch) | |
tree | 6b302b1feb6dcd4d36cc6c9167d0641ef9ab1a36 /apt-pkg/cdrom.cc | |
parent | f9f785cf01c464b56ed51b975bf0cda30f78cd4e (diff) | |
parent | ed0dc1384078765b117f72a0def4fd28a1c7e72b (diff) |
merged from debian-sid
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r-- | apt-pkg/cdrom.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 1e084bfb5..55600fe57 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -868,8 +868,20 @@ pkgUdevCdromDevices::Dlopen() /*{{{*/ return true; } /*}}}*/ + + /*{{{*/ +// compatiblity only with the old API/ABI, can be removed on the next +// ABI break +vector<CdromDevice> +pkgUdevCdromDevices::Scan() +{ + bool CdromOnly = _config->FindB("APT::cdrom::CdromOnly", true); + return ScanForRemovable(CdromOnly); +}; + /*}}}*/ + /*{{{*/ vector<CdromDevice> -pkgUdevCdromDevices::Scan() /*{{{*/ +pkgUdevCdromDevices::ScanForRemovable(bool CdromOnly) { vector<CdromDevice> cdrom_devices; struct udev_enumerate *enumerate; @@ -881,9 +893,10 @@ pkgUdevCdromDevices::Scan() /*{{{*/ udev_ctx = udev_new(); enumerate = udev_enumerate_new (udev_ctx); - udev_enumerate_add_match_property(enumerate, "ID_CDROM", "1"); - //FIXME: just use removalble here to include usb etc - //udev_enumerate_add_match_sysattr(enumerate, "removable", "1"); + if (CdromOnly) + udev_enumerate_add_match_property(enumerate, "ID_CDROM", "1"); + else + udev_enumerate_add_match_sysattr(enumerate, "removable", "1"); udev_enumerate_scan_devices (enumerate); devices = udev_enumerate_get_list_entry (enumerate); @@ -904,9 +917,6 @@ pkgUdevCdromDevices::Scan() /*{{{*/ else mountpath = FindMountPointForDevice(devnode); - if (_config->FindB("Debug::Acquire::cdrom", false)) - cerr << "found " << devnode << " mounted on " << mountpath << endl; - // fill in the struct cdrom.DeviceName = string(devnode); if (mountpath != "") { |