summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2011-03-10 14:42:34 +0100
committerMichael Vogt <mvo@debian.org>2011-03-10 14:42:34 +0100
commite344ad65a4dc36f7fd502193077ae2a3b189eb29 (patch)
tree4539aa3f2dcf05bcf5c1720edf7064a2b6bd7915 /apt-pkg
parented0dc1384078765b117f72a0def4fd28a1c7e72b (diff)
apt-pkg/cdrom.{cc,h}: add (ugly) workaround to ensure the ABI is not broken (also in this case its probably not needed because pkgUDevCDrom is not used outside libapt itself, still its better to be on the save side)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/cdrom.cc9
-rw-r--r--apt-pkg/cdrom.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 55600fe57..36a1d7f12 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -854,7 +854,9 @@ pkgUdevCdromDevices::Dlopen() /*{{{*/
libudev_handle = h;
udev_new = (udev* (*)(void)) dlsym(h, "udev_new");
udev_enumerate_add_match_property = (int (*)(udev_enumerate*, const char*, const char*))dlsym(h, "udev_enumerate_add_match_property");
+#if 0 // FIXME: uncomment on next ABI break
udev_enumerate_add_match_sysattr = (int (*)(udev_enumerate*, const char*, const char*))dlsym(h, "udev_enumerate_add_match_sysattr");
+#endif
udev_enumerate_scan_devices = (int (*)(udev_enumerate*))dlsym(h, "udev_enumerate_scan_devices");
udev_enumerate_get_list_entry = (udev_list_entry* (*)(udev_enumerate*))dlsym(h, "udev_enumerate_get_list_entry");
udev_device_new_from_syspath = (udev_device* (*)(udev*, const char*))dlsym(h, "udev_device_new_from_syspath");
@@ -895,8 +897,13 @@ pkgUdevCdromDevices::ScanForRemovable(bool CdromOnly)
enumerate = udev_enumerate_new (udev_ctx);
if (CdromOnly)
udev_enumerate_add_match_property(enumerate, "ID_CDROM", "1");
- else
+ else {
+#if 1 // FIXME: remove the next two lines on the next ABI break
+ int (*udev_enumerate_add_match_sysattr)(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
+ udev_enumerate_add_match_sysattr = (int (*)(udev_enumerate*, const char*, const char*))dlsym(libudev_handle, "udev_enumerate_add_match_sysattr");
+#endif
udev_enumerate_add_match_sysattr(enumerate, "removable", "1");
+ }
udev_enumerate_scan_devices (enumerate);
devices = udev_enumerate_get_list_entry (enumerate);
diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h
index 032fae755..e83c38582 100644
--- a/apt-pkg/cdrom.h
+++ b/apt-pkg/cdrom.h
@@ -92,7 +92,9 @@ class pkgUdevCdromDevices /*{{{*/
struct udev_enumerate *(*udev_enumerate_new) (struct udev *udev);
struct udev_list_entry *(*udev_list_entry_get_next)(struct udev_list_entry *list_entry);
const char* (*udev_device_get_property_value)(struct udev_device *udev_device, const char *key);
+#if 0 // FIXME: uncomment on next ABI break
int (*udev_enumerate_add_match_sysattr)(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
+#endif
// end libudev dlopen
public: