aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-28 22:57:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-28 22:57:52 +0800
commitd369274ae88a331f19630750ec485ccbcc8b2b3e (patch)
tree5c32424e71ef00f4886d0b56ecbc41107af1ea31 /shell
parentc808d30fbc0aa45163e34584d6fd2c038279ea3d (diff)
downloadgsoc2013-evolution-d369274ae88a331f19630750ec485ccbcc8b2b3e.tar.gz
gsoc2013-evolution-d369274ae88a331f19630750ec485ccbcc8b2b3e.tar.zst
gsoc2013-evolution-d369274ae88a331f19630750ec485ccbcc8b2b3e.zip
Add more debug messages to basedir migration.
If directory removal fails because the directory is not empty, list the file names in that directory.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-migrate.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index cc3036619e..674c8c3f61 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -63,16 +63,33 @@ shell_xdg_migrate_rename (const gchar *old_filename,
static gboolean
shell_xdg_migrate_rmdir (const gchar *dirname)
{
+ GDir *dir = NULL;
gboolean success = TRUE;
if (g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
g_print (" rmdir %s\n", dirname);
if (g_rmdir (dirname) < 0) {
- g_printerr (" FAILED: %s\n", g_strerror (errno));
+ g_printerr (" FAILED: %s", g_strerror (errno));
+ if (errno == ENOTEMPTY) {
+ dir = g_dir_open (dirname, 0, NULL);
+ g_printerr (" (contents follows)");
+ }
+ g_printerr ("\n");
success = FALSE;
}
}
+ /* List the directory's contents to aid debugging. */
+ if (dir != NULL) {
+ const gchar *basename;
+
+ /* Align the filenames beneath the error message. */
+ while ((basename = g_dir_read_name (dir)) != NULL)
+ g_print (" %s\n", basename);
+
+ g_dir_close (dir);
+ }
+
return success;
}