File device-mapper-dmsetup-deps-export.patch of Package lvm2.import5596
Index: LVM2.2.02.67/tools/dmsetup.c
===================================================================
--- LVM2.2.02.67.orig/tools/dmsetup.c 2010-07-05 16:35:06.000000000 +0800
+++ LVM2.2.02.67/tools/dmsetup.c 2010-07-05 17:21:39.000000000 +0800
@@ -1610,6 +1610,7 @@
const char *name = NULL;
const char *uuid = NULL;
struct dm_info info;
+ struct dm_deps *deps;
if (data)
name = names->name;
@@ -1679,6 +1680,28 @@
printf("\n");
}
+ dm_task_destroy(dmt);
+
+ if (!(dmt = dm_task_create(DM_DEVICE_DEPS)))
+ goto out;
+
+ name = NULL;
+ if (data)
+ name = names->name;
+ else if (argc == 2)
+ name = argv[1];
+
+ if (!_set_task_device(dmt, name, 0))
+ goto out;
+
+ if (!dm_task_run(dmt))
+ goto out;
+
+ if (!(deps = dm_task_get_deps(dmt)))
+ goto out;
+
+ printf("DM_DEPS=%d\n", deps->count);
+
r = 1;
out:
if (dmt)