10-size-opt.dpatch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #! /bin/sh -e
  2. ## 10-size-opt.dpatch by Nicolas Boullis <nboullis@debian.org>
  3. ##
  4. ## DP: This patch from Nicolas Boullis <nboullis@debian.org> optimizes isync
  5. ## DP: by not fetching the sizes of messages if they are unneeded (i.e., if
  6. ## DP: MaxSize is not specified in the config file).
  7. [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
  8. patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
  9. if [ $# -ne 1 ]; then
  10. echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
  11. exit 1
  12. fi
  13. case "$1" in
  14. -patch) patch $patch_opts -p1 < $0;;
  15. -unpatch) patch $patch_opts -p1 -R < $0;;
  16. *)
  17. echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
  18. exit 1;;
  19. esac
  20. exit 0
  21. @DPATCH@
  22. ===================================================================
  23. RCS file: isync-0.9.2/src/RCS/isync.h,v
  24. retrieving revision 1.1
  25. diff -u -r1.1 isync-0.9.2/src/isync.h
  26. --- isync-0.9.2/src/isync.h 2004/01/09 23:06:52 1.1
  27. +++ isync-0.9.2/src/isync.h 2004/01/09 23:07:08
  28. @@ -205,7 +205,7 @@
  29. int imap_set_flags (imap_t *, unsigned int, unsigned int);
  30. int imap_expunge (imap_t *);
  31. imap_t *imap_connect (config_t *);
  32. -imap_t *imap_open (config_t *, unsigned int, imap_t *, int);
  33. +imap_t *imap_open (config_t *, unsigned int, imap_t *, int, int);
  34. int imap_append_message (imap_t *, int, message_t *);
  35. int imap_list (imap_t *);
  36. ===================================================================
  37. RCS file: isync-0.9.2/src/RCS/imap.c,v
  38. retrieving revision 1.1
  39. diff -u -r1.1 isync-0.9.2/src/imap.c
  40. --- isync-0.9.2/src/imap.c 2004/01/09 23:08:20 1.1
  41. +++ isync-0.9.2/src/imap.c 2004/01/09 23:09:54
  42. @@ -874,7 +874,8 @@
  43. * mailbox.
  44. */
  45. imap_t *
  46. -imap_open (config_t * box, unsigned int minuid, imap_t * imap, int imap_create)
  47. +imap_open (config_t * box, unsigned int minuid, imap_t * imap,
  48. + int imap_create, int get_size)
  49. {
  50. if (imap)
  51. {
  52. @@ -940,7 +941,8 @@
  53. imap->minuid = minuid;
  54. if (imap->count > 0)
  55. {
  56. - if (imap_exec (imap, "UID FETCH %d:* (FLAGS RFC822.SIZE)", minuid))
  57. + if (imap_exec (imap, "UID FETCH %d:* (FLAGS%s)", minuid,
  58. + get_size ? " RFC822.SIZE" : ""))
  59. goto bail;
  60. }
  61. ===================================================================
  62. RCS file: isync-0.9.2/src/RCS/main.c,v
  63. retrieving revision 1.1
  64. diff -u -r1.1 isync-0.9.2/src/main.c
  65. --- isync-0.9.2/src/main.c 2004/01/09 23:08:20 1.1
  66. +++ isync-0.9.2/src/main.c 2004/01/09 23:08:31
  67. @@ -396,7 +396,7 @@
  68. break;
  69. }
  70. - imap = imap_open (box, fast ? mail->maxuid + 1 : 1, imap, imap_create);
  71. + imap = imap_open (box, fast ? mail->maxuid + 1 : 1, imap, imap_create, box->max_size!=0);
  72. if (!imap)
  73. {
  74. fprintf (stderr, "%s: skipping mailbox due to IMAP error\n",