From fcbe40dc6bbfe0ef07049072869609ac4743281f Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sun, 24 Jun 2012 11:31:37 -0400 Subject: [PATCH] Drop the 'drive-' prefix for drive configuration files In the future we may want to use the same configuration file format for block devices. Signed-off-by: David Zeuthen --- data/org.freedesktop.UDisks2.xml | 2 +- doc/man/udisks.xml | 2 +- src/udiskslinuxdrive.c | 2 +- src/udiskslinuxdriveata.c | 2 +- src/udiskslinuxprovider.c | 5 ++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml index 180f9a9..eb7f8c9 100644 --- a/data/org.freedesktop.UDisks2.xml +++ b/data/org.freedesktop.UDisks2.xml @@ -319,7 +319,7 @@ The contents of this property is read from the configuration - file /etc/udisks2/drive-IDENTIFIER.conf + file /etc/udisks2/IDENTIFIER.conf where IDENTIFIER is the value of the #org.freedesktop.UDisks2.Drive:Id property. See for the file format of this file. diff --git a/doc/man/udisks.xml b/doc/man/udisks.xml index 0ab40af..e31736a 100644 --- a/doc/man/udisks.xml +++ b/doc/man/udisks.xml @@ -63,7 +63,7 @@ At start-up and when a drive is connected, udisksd8 will apply configuration stored in the file - /etc/udisks2/drive-IDENTIFIER.conf + /etc/udisks2/IDENTIFIER.conf where IDENTIFIER is the value of the Drive:Id property for the drive. If the file changes on disk its new diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxdrive.c index 722921c..5c7eba3 100644 --- a/src/udiskslinuxdrive.c +++ b/src/udiskslinuxdrive.c @@ -224,7 +224,7 @@ configuration_get_path (UDisksLinuxDrive *drive) if (id == NULL || strlen (id) == 0) goto out; - path = g_strdup_printf (PACKAGE_SYSCONF_DIR "/udisks2/drive-%s.conf", id); + path = g_strdup_printf (PACKAGE_SYSCONF_DIR "/udisks2/%s.conf", id); out: return path; diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c index a63700d..d93a550 100644 --- a/src/udiskslinuxdriveata.c +++ b/src/udiskslinuxdriveata.c @@ -1658,7 +1658,7 @@ apply_configuration_thread_func (gpointer user_data) device_file = g_udev_device_get_device_file (data->device); - udisks_notice ("Applying configuration from %s/udisks2/drive-%s.conf to %s", + udisks_notice ("Applying configuration from %s/udisks2/%s.conf to %s", PACKAGE_SYSCONF_DIR, udisks_drive_get_id (data->drive), device_file); diff --git a/src/udiskslinuxprovider.c b/src/udiskslinuxprovider.c index 49675db..62410ee 100644 --- a/src/udiskslinuxprovider.c +++ b/src/udiskslinuxprovider.c @@ -241,11 +241,10 @@ on_etc_udisks2_dir_monitor_changed (GFileMonitor *monitor, event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT) { gchar *filename = g_file_get_basename (file); - if (g_str_has_prefix (filename, "drive-") && g_str_has_suffix (filename, ".conf")) + if (g_str_has_suffix (filename, ".conf")) { gchar *id; - id = g_strndup (filename + strlen ("drive-"), - strlen (filename) - strlen ("drive-") - strlen(".conf")); + id = g_strndup (filename, strlen (filename) - strlen(".conf")); update_drive_with_id (provider, id); g_free (id); } -- 2.7.4