aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-09 10:11:09 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-09 10:11:09 +0800
commitfabe4f1d8ae42c7bf8f1674c98ef4103e2e53bf0 (patch)
treed38240727078c7a537a01f3b23abf555f390aa9c
parentbe3def8d200a27d4e5282c8c269ae2c017208cfa (diff)
downloadgsoc2013-evolution-fabe4f1d8ae42c7bf8f1674c98ef4103e2e53bf0.tar.gz
gsoc2013-evolution-fabe4f1d8ae42c7bf8f1674c98ef4103e2e53bf0.tar.zst
gsoc2013-evolution-fabe4f1d8ae42c7bf8f1674c98ef4103e2e53bf0.zip
Now takes a pattern argument to limit files that get copied over (so we
2004-04-08 Jeffrey Stedfast <fejj@ximian.com> * em-migrate.c (cp_r): Now takes a pattern argument to limit files that get copied over (so we can limit imap cache to only the summary files - makes it faster). svn path=/trunk/; revision=25378
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/em-migrate.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 717322f11e..e44abda8e2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,9 @@
2004-04-08 Jeffrey Stedfast <fejj@ximian.com>
+ * em-migrate.c (cp_r): Now takes a pattern argument to limit files
+ that get copied over (so we can limit imap cache to only the
+ summary files - makes it faster).
+
* mail-account-gui.c (mail_account_gui_build_extra_conf): Fixed up
a bit to look nicer and make it closer to HIG compliant.
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 2bd54e0ca6..d2cd7f31f3 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -1364,7 +1364,7 @@ cp (const char *src, const char *dest, gboolean show_progress)
}
static int
-cp_r (const char *src, const char *dest)
+cp_r (const char *src, const char *dest, const char *pattern)
{
GString *srcpath, *destpath;
struct dirent *dent;
@@ -1400,8 +1400,8 @@ cp_r (const char *src, const char *dest)
continue;
if (S_ISDIR (st.st_mode)) {
- cp_r (srcpath->str, destpath->str);
- } else {
+ cp_r (srcpath->str, destpath->str, pattern);
+ } else if (!pattern || !strcmp (dent->d_name, pattern)) {
cp (srcpath->str, destpath->str, FALSE);
}
}
@@ -1970,7 +1970,7 @@ em_migrate_imap_caches_1_4 (const char *evolution_dir, CamelException *ex)
dest = g_build_filename (evolution_dir, "mail", "imap", NULL);
/* we don't care if this fails, it's only a cache... */
- rename (src, dest);
+ cp_r (src, dest, "summary");
g_free (dest);
g_free (src);