[packages/archivemail] Up to 0.9.0
arekm
arekm at pld-linux.org
Fri Nov 27 22:02:35 CET 2026
commit 89c1a730cff027cd3ce4f4ed1ba817e622d7dee7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Nov 27 15:58:44 2026 +0100
Up to 0.9.0
archivemail-add-archive-all-switch.patch | 139 ---------------------------
archivemail-add-archive-name-switch.patch | 71 --------------
archivemail-add-prefix-switch.patch | 142 ----------------------------
archivemail-empty-mailbox-objects-fix.patch | 17 ----
archivemail-preserve-symlinks.patch | 97 -------------------
archivemail-python2-fix.patch | 28 ------
archivemail-relax-timestamps-test.patch | 65 ++++---------
archivemail.spec | 28 ++----
8 files changed, 27 insertions(+), 560 deletions(-)
---
diff --git a/archivemail.spec b/archivemail.spec
index 24cad17..f02024c 100644
--- a/archivemail.spec
+++ b/archivemail.spec
@@ -5,20 +5,14 @@
Summary: Archive and compress old email
Summary(pl.UTF-8): Archiwizowanie starej poczty
Name: archivemail
-Version: 0.7.2
-Release: 4
+Version: 0.9.0
+Release: 1
License: GPL
Group: Applications/Mail
-Source0: http://dl.sourceforge.net/archivemail/%{name}-%{version}.tar.gz
-# Source0-md5: e444424688e6ec063e829176e4eb62e2
-Patch0: %{name}-add-archive-name-switch.patch
-Patch1: %{name}-empty-mailbox-objects-fix.patch
-Patch2: %{name}-fix-path-in-example.patch
-Patch3: %{name}-preserve-symlinks.patch
-Patch4: %{name}-add-prefix-switch.patch
-Patch5: %{name}-add-archive-all-switch.patch
-Patch6: %{name}-relax-timestamps-test.patch
-Patch7: %{name}-python2-fix.patch
+Source0: https://downloads.sourceforge.net/archivemail/%{name}-%{version}.tar.gz
+# Source0-md5: ee36b3e8451ec563ae9338f3dd75e3f6
+Patch0: %{name}-fix-path-in-example.patch
+Patch1: %{name}-relax-timestamps-test.patch
URL: http://archivemail.sourceforge.net/
BuildRequires: rpmbuild(macros) >= 1.710
BuildRequires: python-devel >= 2.0
@@ -64,21 +58,15 @@ skrzynek pocztowych: IMAP, Maildir, MH oraz mbox.
%setup -q
%patch -P0 -p1
%patch -P1 -p1
-%patch -P2 -p1
-%patch -P3 -p1
-%patch -P4 -p1
-%patch -P5 -p1
-%patch -P6 -p1
-%patch -P7 -p1
-%{__sed} -i -e 's,man/man1,%{_mandir}/man1,' setup.py
+%{__sed} -i -e '1s,/usr/bin/env python,/usr/bin/env python2,' archivemail
%build
%py_build
%if %{with tests}
ln -sf archivemail archivemail.py
-%{__python} test_archivemail.py
+%{__python} test_archivemail
%endif
%install
diff --git a/archivemail-add-archive-all-switch.patch b/archivemail-add-archive-all-switch.patch
deleted file mode 100644
index 553820c..0000000
--- a/archivemail-add-archive-all-switch.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-# Description: add, document and test --all option
-# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=470675
-# Author: Serafeim Zanikolas <serzan at hellug.gr>
-# Last-Update: 2009-02-22
-Index: archivemail/archivemail
-===================================================================
---- archivemail.orig/archivemail 2008-09-06 15:11:32.000000000 +0100
-+++ archivemail/archivemail 2008-09-06 15:14:23.000000000 +0100
-@@ -179,6 +179,7 @@
- delete_old_mail = 0
- dry_run = 0
- filter_append = None
-+ archive_all = 0
- include_flagged = 0
- lockfile_attempts = 5
- lockfile_extension = ".lock"
-@@ -209,14 +210,14 @@
-
- """
- try:
-- opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uvp:',
-+ opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uvp:',
- ["date=", "days=", "delete", "dry-run", "help",
- "include-flagged", "no-compress", "output-dir=",
- "archive-name=",
- "filter-append=", "pwfile=", "dont-mangle",
- "preserve-unread", "quiet", "size=", "suffix=",
- "verbose", "version", "warn-duplicate", "copy",
-- "prefix="])
-+ "prefix=", "all"])
- except getopt.error, msg:
- user_error(msg)
-
-@@ -227,6 +228,8 @@
- if self.copy_old_mail:
- user_error("found conflicting options --copy and --delete")
- self.delete_old_mail = 1
-+ if o == ('--all'):
-+ self.archive_all = 1
- if o == '--include-flagged':
- self.include_flagged = 1
- if o == '--no-compress':
-@@ -277,6 +280,9 @@
- if o in ('-V', '--version'):
- print __version__ + "\n\n" + __copyright__
- sys.exit(0)
-+ if self.archive_all and archive_by:
-+ user_error("--all must not be used with other " +
-+ "filtering options")
- return args
-
- def sanity_check(self):
-@@ -681,6 +687,8 @@
- mailbox compressed with gzip.
-
- Options are as follows:
-+ --all archive all messages (not to be used along with other
-+ filter switches; use with caution)
- -d, --days=NUM archive messages older than NUM days (default: %d)
- -D, --date=DATE archive messages older than DATE
- -o, --output-dir=DIR directory to store archives (default: same as original)
-@@ -1009,6 +1017,8 @@
-
- def should_archive(message):
- """Return true if we should archive the message, false otherwise"""
-+ if options.archive_all:
-+ return 1
- old = 0
- time_message = guess_delivery_time(message)
- if options.date_old_max == None:
-Index: archivemail/archivemail.sgml
-===================================================================
---- archivemail.orig/archivemail.sgml 2008-09-06 15:11:32.000000000 +0100
-+++ archivemail/archivemail.sgml 2008-09-06 15:16:25.000000000 +0100
-@@ -119,6 +119,15 @@
-
- <VarListEntry>
- <Term>
-+ <Option>--all</Option>
-+</Term>
-+<ListItem><Para>
-+Archive _all_ messages. Not to be combined with other filter switches.
-+</Para></ListItem>
-+</VarListEntry>
-+
-+<VarListEntry>
-+<Term>
- <Option>-d <Replaceable/NUM/, --days=<Replaceable/NUM/</Option>
- </Term>
- <ListItem><Para>Archive messages older than <Replaceable/NUM/ days.
-Index: archivemail/test_archivemail.py
-===================================================================
---- archivemail.orig/test_archivemail.py 2008-09-06 15:13:17.000000000 +0100
-+++ archivemail/test_archivemail.py 2008-09-06 19:58:49.000000000 +0100
-@@ -974,6 +974,44 @@
- super(TestArchiveDryRun, self).tearDown()
-
-
-+class TestArchiveAll(TestCaseInTempdir):
-+ """make sure the 'all' option works"""
-+ def setUp(self):
-+ super(TestArchiveAll, self).setUp()
-+ archivemail.options.quiet = 1
-+
-+ def testValidUse(self):
-+ """test that it works when used without any other archive_by option"""
-+ for execute in ("package", "system_long"):
-+ self.setUp()
-+ self.mbox_name = make_mbox(messages=3, hours_old=(24 * 12))
-+ self.mbox = archivemail.Mbox(self.mbox_name)
-+ if execute == "package":
-+ archivemail.options.archive_all = 1
-+ archivemail.archive(self.mbox_name)
-+ elif execute == "system_long":
-+ run = "./archivemail.py --all --quiet "\
-+ + "%s 2>&1 >/dev/null" % self.mbox_name
-+ self.assertEqual(os.system(run), 0)
-+ else:
-+ sys.exit(1)
-+ assert(os.path.exists(self.mbox_name))
-+ self.assertTrue(self.mbox.is_empty())
-+ self.tearDown()
-+
-+ def testInvalidUses(self):
-+ """test that it gives up with invoked with either -d or -D"""
-+ for arg in ["-d 30", "--days=30",\
-+ "-D 2008-07-30", "--date=2008-07-30"]:
-+ run = ("./archivemail.py --all %s --quiet "\
-+ + "whatever >/dev/null 2>&1") % arg
-+ self.assertEqual(os.system(run), 256)
-+
-+ def tearDown(self):
-+ archivemail.options.archive_all = 0
-+ archivemail.options.quiet = 0
-+ super(TestArchiveAll, self).tearDown()
-+
- class TestArchiveDays(TestCaseInTempdir):
- """make sure the 'days' option works"""
- def setUp(self):
diff --git a/archivemail-add-archive-name-switch.patch b/archivemail-add-archive-name-switch.patch
deleted file mode 100644
index 4cfca71..0000000
--- a/archivemail-add-archive-name-switch.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-# Description: add and document --archive-name option
-# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247340
-# Author: Serafeim Zanikolas <serzan at hellug.gr>
-# Last-Update: 2008-08-15
-Index: archivemail/archivemail
-===================================================================
---- archivemail.orig/archivemail 2008-08-15 20:38:03.000000000 +0100
-+++ archivemail/archivemail 2008-08-15 21:39:57.000000000 +0100
-@@ -172,6 +172,7 @@
- class Options:
- """Class to store runtime options, including defaults"""
- archive_suffix = "_archive"
-+ archive_name = None
- days_old_max = 180
- date_old_max = None
- delete_old_mail = 0
-@@ -210,6 +211,7 @@
- opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uv',
- ["date=", "days=", "delete", "dry-run", "help",
- "include-flagged", "no-compress", "output-dir=",
-+ "archive-name=",
- "filter-append=", "pwfile=", "dont-mangle",
- "preserve-unread", "quiet", "size=", "suffix=",
- "verbose", "version", "warn-duplicate", "copy"])
-@@ -262,6 +264,8 @@
- self.mangle_from = 0
- if o in ('-v', '--verbose'):
- self.verbose = 1
-+ if o in ('--archive-name'):
-+ self.archive_name = os.path.expanduser(a)
- if o == '--copy':
- if self.delete_old_mail:
- user_error("found conflicting options --copy and --delete")
-@@ -663,6 +667,8 @@
- -P, --pwfile=FILE file to read imap password from (default: None)
- -F, --filter-append=STRING append arbitrary string to the IMAP filter string
- -s, --suffix=NAME suffix for archive filename (default: '%s')
-+ --archive-name=NAME specify whole archive filename, overrides prefix
-+ and suffix
- -S, --size=NUM only archive messages NUM bytes or larger
- -n, --dry-run don't write to anything - just show what would be done
- -u, --preserve-unread never archive unread messages
-@@ -1102,6 +1108,8 @@
- final_archive_name = mailbox_name.split('/')[-1] + parsed_suffix
- else:
- final_archive_name = mailbox_name + parsed_suffix
-+ if options.archive_name:
-+ final_archive_name = options.archive_name
- if options.output_dir:
- final_archive_name = os.path.join(options.output_dir,
- os.path.basename(final_archive_name))
-Index: archivemail/archivemail.sgml
-===================================================================
---- archivemail.orig/archivemail.sgml 2008-08-15 20:38:03.000000000 +0100
-+++ archivemail/archivemail.sgml 2008-08-15 21:38:49.000000000 +0100
-@@ -238,6 +238,15 @@
-
- <VarListEntry>
- <Term>
-+ <Option>--archive-name</Option>
-+</Term>
-+<ListItem><Para>
-+Specify whole archive filename, overrides prefix and suffix.
-+</Para></ListItem>
-+</VarListEntry>
-+
-+<VarListEntry>
-+<Term>
- <Option>-S <Replaceable/NUM/, --size=<Replaceable/NUM/</Option>
- </Term>
- <ListItem><Para>Only archive messages that are <Replaceable/NUM/ bytes or
diff --git a/archivemail-add-prefix-switch.patch b/archivemail-add-prefix-switch.patch
deleted file mode 100644
index b1e7d39..0000000
--- a/archivemail-add-prefix-switch.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-# Description: add, document and test --prefix option for archive name
-# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247340
-# Author: Serafeim Zanikolas <serzan at hellug.gr>
-# Last-Update: 2009-02-22
-Index: archivemail/archivemail
-===================================================================
---- archivemail.orig/archivemail 2008-08-15 21:40:17.000000000 +0100
-+++ archivemail/archivemail 2008-08-15 21:40:17.000000000 +0100
-@@ -171,6 +171,7 @@
-
- class Options:
- """Class to store runtime options, including defaults"""
-+ archive_prefix = None
- archive_suffix = "_archive"
- archive_name = None
- days_old_max = 180
-@@ -208,13 +209,14 @@
-
- """
- try:
-- opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uv',
-+ opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uvp:',
- ["date=", "days=", "delete", "dry-run", "help",
- "include-flagged", "no-compress", "output-dir=",
-- "archive-name=",
-+ "archive-name=",
- "filter-append=", "pwfile=", "dont-mangle",
- "preserve-unread", "quiet", "size=", "suffix=",
-- "verbose", "version", "warn-duplicate", "copy"])
-+ "verbose", "version", "warn-duplicate", "copy",
-+ "prefix="])
- except getopt.error, msg:
- user_error(msg)
-
-@@ -254,6 +256,8 @@
- self.dry_run = 1
- if o in ('-q', '--quiet'):
- self.quiet = 1
-+ if o in ('-p', '--prefix'):
-+ self.archive_prefix = a
- if o in ('-s', '--suffix'):
- self.archive_suffix = a
- if o in ('-S', '--size'):
-@@ -682,6 +686,7 @@
- -o, --output-dir=DIR directory to store archives (default: same as original)
- -P, --pwfile=FILE file to read imap password from (default: None)
- -F, --filter-append=STRING append arbitrary string to the IMAP filter string
-+ -p, --prefix=NAME prefix for archive filename (default: none)
- -s, --suffix=NAME suffix for archive filename (default: '%s')
- --archive-name=NAME specify whole archive filename, overrides prefix
- and suffix
-@@ -1124,8 +1129,11 @@
- final_archive_name = mailbox_name.split('/')[-1] + parsed_suffix
- else:
- final_archive_name = mailbox_name + parsed_suffix
-+ if options.archive_prefix:
-+ final_archive_name = os.path.join(os.path.dirname(final_archive_name),\
-+ options.archive_prefix + os.path.basename(final_archive_name))
- if options.archive_name:
-- final_archive_name = options.archive_name
-+ final_archive_name = options.archive_name
- if options.output_dir:
- final_archive_name = os.path.join(options.output_dir,
- os.path.basename(final_archive_name))
-Index: archivemail/test_archivemail.py
-===================================================================
---- archivemail.orig/test_archivemail.py 2008-08-15 21:40:17.000000000 +0100
-+++ archivemail/test_archivemail.py 2008-08-15 21:40:17.000000000 +0100
-@@ -889,6 +889,54 @@
- archivemail.options.archive_suffix = "_archive"
- super(TestArchiveMboxSuffix, self).tearDown()
-
-+class TestArchiveMboxPrefix(TestCaseInTempdir):
-+ """make sure the 'prefix' option works"""
-+ def setUp(self):
-+ super(TestArchiveMboxPrefix, self).setUp()
-+ archivemail.options.quiet = 1
-+
-+ def testPrefix(self):
-+ """archiving with specified --prefix arguments"""
-+ for prefix in ["blah-"]:
-+ for execute in ("system_long", "system_short", "package"):
-+ self.setUp()
-+ days_old_max = 180
-+ self.mbox_name = make_mbox(messages=3,
-+ hours_old=(24 * (days_old_max+1)))
-+ self.copy_name = tempfile.mkstemp()[1]
-+ shutil.copyfile(self.mbox_name, self.copy_name)
-+ if execute == "system_long":
-+ run = "./archivemail.py --quiet --prefix='%s' %s" % \
-+ (prefix, self.mbox_name)
-+ self.assertEqual(os.system(run), 0)
-+ elif execute == "system_short":
-+ run = "./archivemail.py --quiet -p'%s' %s" % \
-+ (prefix, self.mbox_name)
-+ self.assertEqual(os.system(run), 0)
-+ elif execute == "package":
-+ archivemail.options.archive_prefix = prefix
-+ archivemail.archive(self.mbox_name)
-+ else:
-+ sys.exit(1)
-+ assert(os.path.exists(self.mbox_name))
-+ self.assertEqual(os.path.getsize(self.mbox_name), 0)
-+
-+ archive_name = os.path.join(os.path.dirname(self.mbox_name),\
-+ prefix + os.path.basename(self.mbox_name) +\
-+ "_archive.gz")
-+ assert(os.path.exists(archive_name))
-+ self.assertEqual(os.system("gzip -d %s" % archive_name), 0)
-+ archive_name = re.sub("\.gz$", "", archive_name)
-+ assert(os.path.exists(archive_name))
-+ assert(filecmp.cmp(archive_name, self.copy_name, shallow=0))
-+ os.remove(archive_name)
-+ self.tearDown()
-+
-+ def tearDown(self):
-+ archivemail.options.quiet = 0
-+ archivemail.options.archive_prefix = None
-+ super(TestArchiveMboxPrefix, self).tearDown()
-+
-
- class TestArchiveDryRun(TestCaseInTempdir):
- """make sure the 'dry-run' option works"""
-Index: archivemail/archivemail.sgml
-===================================================================
---- archivemail.orig/archivemail.sgml 2008-08-15 21:38:49.000000000 +0100
-+++ archivemail/archivemail.sgml 2008-08-15 21:40:34.000000000 +0100
-@@ -170,6 +170,14 @@
-
- <VarListEntry>
- <Term>
-+ <Option>-p <Replaceable/NAME/, --prefix=<Replaceable/NAME/</Option>
-+</Term>
-+<ListItem><Para>Prefix <Replaceable/NAME/ to the archive name.
-+</Para></ListItem>
-+</VarListEntry>
-+
-+<VarListEntry>
-+<Term>
- <Option>-s <Replaceable/NAME/, --suffix=<Replaceable/NAME/</Option>
- </Term>
- <ListItem><Para>
diff --git a/archivemail-empty-mailbox-objects-fix.patch b/archivemail-empty-mailbox-objects-fix.patch
deleted file mode 100644
index ce5b212..0000000
--- a/archivemail-empty-mailbox-objects-fix.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-# Description: add, document and test --all option
-# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476806
-# Author: Joey Hess <joeyh at debian.org>
-# Last-Update: 2008-08-14
-Index: archivemail/archivemail
-===================================================================
---- archivemail.orig/archivemail 2008-08-14 21:24:03.000000000 +0100
-+++ archivemail/archivemail 2008-08-14 21:24:12.000000000 +0100
-@@ -1278,7 +1278,7 @@
- original = mailbox.MHMailbox(mailbox_name)
- else:
- unexpected_error("unknown type: %s" % type)
-- assert(original)
-+ assert(original is not None)
-
- cache = IdentityCache(mailbox_name)
-
diff --git a/archivemail-preserve-symlinks.patch b/archivemail-preserve-symlinks.patch
deleted file mode 100644
index 55a255a..0000000
--- a/archivemail-preserve-symlinks.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-# Description: do not overwrite <mailbox>_archive.gz when it is a symbolic link
-# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=349068
-# Author: Serafeim Zanikolas <serzan at hellug.gr>
-# Last-Update: 2009-02-22
-Index: archivemail/archivemail
-===================================================================
---- archivemail.orig/archivemail 2008-08-15 21:41:37.000000000 +0100
-+++ archivemail/archivemail 2008-08-15 22:00:20.000000000 +0100
-@@ -487,6 +487,20 @@
- """Return the current size of the mbox file"""
- return os.path.getsize(self.mbox_file_name)
-
-+ def get_link_target(self, file_name):
-+ """Return the supplied file name if not a link; else its target."""
-+ if not os.path.islink(file_name):
-+ return file_name
-+ orig_file_name = prev = file_name
-+ while os.path.islink(file_name):
-+ prev = file_name
-+ file_name = os.readlink(file_name)
-+ if not os.path.isabs(file_name):
-+ file_name = os.path.abspath(os.path.join(os.path.dirname(prev),
-+ file_name))
-+ if not os.path.exists(file_name):
-+ unexpected_error("%s is a broken symbolic link" % orig_file_name)
-+ return file_name
-
- class RetainMbox(Mbox):
- """Class for holding messages that will be retained from the original
-@@ -525,6 +539,7 @@
- mode = os.stat(self.__final_name)[stat.ST_MODE]
- os.chmod(self.mbox_file_name, mode)
-
-+ self.__final_name = self.get_link_target(self.__final_name)
- vprint("renaming '%s' to '%s'" % (self.mbox_file_name, self.__final_name))
- try:
- os.rename(self.mbox_file_name, self.__final_name)
-@@ -615,6 +630,7 @@
- final_name = self.__final_name
- if not options.no_compress:
- final_name = final_name + ".gz"
-+ final_name = self.get_link_target(final_name)
- vprint("renaming '%s' to '%s'" % (self.mbox_file_name,
- final_name))
- try:
-@@ -1145,9 +1161,6 @@
- tempfile.tempdir = new_temp_dir
- vprint("set tempfile directory to '%s'" % new_temp_dir)
-
-- if os.path.islink(mailbox_name):
-- unexpected_error("'%s' is a symbolic link -- I feel nervous!" %
-- mailbox_name)
- if imap_scheme == 'imap' or imap_scheme == 'imaps':
- vprint("guessing mailbox is of type: imap(s)")
- _archive_imap(mailbox_name, final_archive_name)
-Index: archivemail/test_archivemail.py
-===================================================================
---- archivemail.orig/test_archivemail.py 2008-08-15 21:40:56.000000000 +0100
-+++ archivemail/test_archivemail.py 2008-08-15 21:59:10.000000000 +0100
-@@ -99,6 +99,37 @@
-
- ############ Mbox Class testing ##############
-
-+class TestMboxSymLinkResolution(TestCaseInTempdir):
-+ def setUp(self):
-+ super(TestMboxSymLinkResolution, self).setUp()
-+ self.mbox_file_name = make_mbox()
-+ self.mbox = archivemail.Mbox(self.mbox_file_name)
-+
-+ def testAbsoluteSymlink(self):
-+ """Resolve an absolute symlink in a different directory"""
-+ link_name = "%s/symlink-to-mbox" % tempfile.mkdtemp()
-+ os.symlink(self.mbox_file_name, link_name)
-+ link_target = self.mbox.get_link_target(link_name)
-+ self.assertEqual(self.mbox_file_name, link_target)
-+
-+ def testRelativeSymlink(self):
-+ """Resolve a relative symlink in a different directory"""
-+ link_dir = tempfile.mkdtemp()
-+ link_name = "%s/symlink-to-mbox" % link_dir
-+ run = "cd %s && ln -s ../%s %s" % (link_dir,\
-+ os.path.basename(self.mbox_file_name),\
-+ os.path.basename(link_name))
-+ self.assertEqual(os.system(run), 0)
-+ link_target = self.mbox.get_link_target(link_name)
-+ self.assertEqual(self.mbox_file_name, link_target)
-+
-+ def testBrokenSymlink(self):
-+ """Archive name that is a broken link should raise an error"""
-+ link_name = "%s/symlink-to-mbox" % tempfile.mkdtemp()
-+ os.symlink("%s-missing" % self.mbox_file_name, link_name)
-+ self.assertRaises(archivemail.UnexpectedError,
-+ self.mbox.get_link_target, link_name)
-+
- class TestMboxIsEmpty(TestCaseInTempdir):
- def setUp(self):
- super(TestMboxIsEmpty, self).setUp()
diff --git a/archivemail-python2-fix.patch b/archivemail-python2-fix.patch
deleted file mode 100644
index 0acefbe..0000000
--- a/archivemail-python2-fix.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- archivemail-0.7.2/archivemail.orig
-+++ archivemail-0.7.2/archivemail
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#! /usr/bin/env python2
- ############################################################################
- # Copyright (C) 2002 Paul Rodger <paul at paulrodger.com>,
- # (C) 2006 Peter Poeml <poeml at suse.de>,
-@@ -1123,7 +1123,7 @@
- assert(mailbox_name)
-
- set_signal_handlers()
-- os.umask(077) # saves setting permissions on mailboxes/tempfiles
-+ os.umask(0o77) # saves setting permissions on mailboxes/tempfiles
-
- # allow the user to embed time formats such as '%B' in the suffix string
- if options.date_old_max == None:
---- archivemail-0.7.2/test_archivemail.py.orig
-+++ archivemail-0.7.2/test_archivemail.py
-@@ -336,7 +336,7 @@
-
- def testJustOld(self):
- """with max_days=1, should be true for these dates >= 1 day"""
-- for minutes in range(0, 61):
-+ for minutes in range(0, 59):
- time_msg = time.time() - (25 * 60 * 60) + (minutes * 60)
- assert(archivemail.is_older_than_days(time_message=time_msg,
- max_days=1))
diff --git a/archivemail-relax-timestamps-test.patch b/archivemail-relax-timestamps-test.patch
index d1e2065..8e616f6 100644
--- a/archivemail-relax-timestamps-test.patch
+++ b/archivemail-relax-timestamps-test.patch
@@ -1,48 +1,21 @@
-# Description: add, document and test --all option
-# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549736
-# Author: Nikolaus Schulz <microschulz at web.de>
-# Last-Update: 2009-10-10
---- a/test_archivemail.py
-+++ b/test_archivemail.py
-@@ -69,6 +69,8 @@
- print "Try renaming it from 'archivemail' to 'archivemail.py'."
- sys.exit(1)
-
-+# precision of os.utime() when restoring mbox timestamps
-+utimes_precision = 5
-
- class TestCaseInTempdir(unittest.TestCase):
- """Base class for testcases that need to create temporary files.
-@@ -718,8 +720,8 @@
- assert(os.path.exists(self.mbox_name))
- new_atime = os.path.getatime(self.mbox_name)
- new_mtime = os.path.getmtime(self.mbox_name)
-- self.assertEqual(self.mtime, new_mtime)
-- self.assertEqual(self.atime, new_atime)
-+ self.assertAlmostEqual(self.mtime, new_mtime, utimes_precision)
-+ self.assertAlmostEqual(self.atime, new_atime, utimes_precision)
- self.tearDown()
-
- def testMixed(self):
-@@ -741,8 +743,8 @@
- assert(os.path.exists(self.mbox_name))
- new_atime = os.path.getatime(self.mbox_name)
- new_mtime = os.path.getmtime(self.mbox_name)
-- self.assertEqual(self.mtime, new_mtime)
-- self.assertEqual(self.atime, new_atime)
-+ self.assertAlmostEqual(self.mtime, new_mtime, utimes_precision)
-+ self.assertAlmostEqual(self.atime, new_atime, utimes_precision)
- self.tearDown()
-
+--- a/test_archivemail
++++ b/test_archivemail
+@@ -509,13 +509,16 @@
def testOld(self):
-@@ -764,8 +766,8 @@
- assert(os.path.exists(self.mbox_name))
- new_atime = os.path.getatime(self.mbox_name)
- new_mtime = os.path.getmtime(self.mbox_name)
-- self.assertEqual(self.mtime, new_mtime)
-- self.assertEqual(self.atime, new_atime)
-+ self.assertAlmostEqual(self.mtime, new_mtime, utimes_precision)
-+ self.assertAlmostEqual(self.atime, new_atime, utimes_precision)
- self.tearDown()
+ """with max_days=14, should be true for these dates > 14 days"""
+ for days in range(14, 360):
+- time_msg = time.time() - (days * 24 * 60 * 60)
++ # one second past the limit: time.time() may not advance between
++ # taking the timestamp and comparing it, making exactly 14 days not old
++ time_msg = time.time() - (days * 24 * 60 * 60) - 1
+ assert archivemail.is_older_than_days(time_message=time_msg,
+ max_days=14)
- def tearDown(self):
+ def testJustOld(self):
+ """with max_days=1, should be true for these dates >= 1 day"""
+- for minutes in range(0, 61):
++ for minutes in range(0, 60):
++ # minutes == 60 is exactly 1 day, which is not older than 1 day
+ time_msg = time.time() - (25 * 60 * 60) + (minutes * 60)
+ assert archivemail.is_older_than_days(time_message=time_msg,
+ max_days=1)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/archivemail.git/commitdiff/89c1a730cff027cd3ce4f4ed1ba817e622d7dee7
More information about the pld-cvs-commit
mailing list