summaryrefslogtreecommitdiff
path: root/apt-pkg/cdrom.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-03-04 22:24:09 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-03-04 22:24:09 +0100
commitef38181605be2f7131bed9865d965300339389b5 (patch)
tree0ba041e882900e6ce104f28334521d3cbb728f21 /apt-pkg/cdrom.cc
parentb7bc31eb0bd71e2a3466df334a52a2c37c444d40 (diff)
apt-pkg/contrib/cdromutl.{cc,h}: add FindMountPointForDevice helper; apt-pkg/cdrom.cc: deal with missing FSTAB_DIR
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r--apt-pkg/cdrom.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 3dc7e9924..86fe45fbe 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -882,6 +882,8 @@ 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");
udev_enumerate_scan_devices (enumerate);
devices = udev_enumerate_get_list_entry (enumerate);
@@ -894,6 +896,11 @@ pkgUdevCdromDevices::Scan() /*{{{*/
continue;
const char* devnode = udev_device_get_devnode(udevice);
const char* mountpath = udev_device_get_property_value(udevice, "FSTAB_DIR");
+ if (mountpath == NULL)
+ 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);