Package: spambayes
Version: 1.0.4-5
Severity: normal
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu intrepid ubuntu-patch

Hi,

The Ubuntu changes to spambayes, in Ubuntu version 1.0.4-4ubuntu1,
achieve the same changes that have been achieved in 1.0.4-5 in a more
maintainable way, specifically keeping the changes in the debian/
directory, thereby enhancing the maintainability of the package.

We've also simplified the unpatch target in debian/rules.

In Ubuntu, we've applied the attached patch to achieve the following:

  * Merge from debian unstable, remaining changes:
    - Add debian/patches/fix_import_future.dpatch to fix all instances
      of from future import not being at the start of the file.
    - Simplify debian/rules so unpatch actually works.
    - Remove dh_python from debian/rules (not needed)
    - Add build-dep on dpatch

We thought you might be interested in doing the same.

-- System Information:
Debian Release: lenny/sid
  APT prefers hardy-updates
  APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 
'hardy-backports'), (500, 'hardy')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-17-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u spambayes-1.0.4/debian/rules spambayes-1.0.4/debian/rules
--- spambayes-1.0.4/debian/rules
+++ spambayes-1.0.4/debian/rules
@@ -5,7 +5,7 @@
 
 SB=debian/spambayes
 
-debian_patches=spambayes
+debian_patches=spambayes fix_import_future
 
 build: build-stamp
 build-stamp: patched-stamp
@@ -16,7 +16,7 @@
        cp CHANGELOG.txt changelog
        touch build-stamp
 
-clean: reverse-patches
+clean: unpatch
        dh_testdir
        rm -f build-stamp install-stamp
        rm -rf build $(SB)
@@ -63,23 +63,10 @@
 patch_dir       = debian/patches
 
 apply-patches: patched-stamp
-reverse-patches:
-       @for stamp in none patched-*; do \
-               case "$$stamp" in none|patched-stamp|patched-\*) continue; 
esac; \
-               patch=`echo $$stamp | sed -e 's/patched-//'`; \
-               echo "trying to revert patch $$patch ..."; \
-               if [ -x $(patch_dir)/$$patch.dpatch ]; then true; else \
-                       chmod +x $(patch_dir)/$$patch.dpatch; fi; \
-               if $(patch_dir)/$$patch.dpatch -unpatch; then \
-                       echo "reverted $$patch patch."; \
-                       rm -f $$stamp; \
-               else \
-                       echo "error in reverting $$patch patch."; \
-                       exit 1; \
-               fi; \
-       done
-       @echo "Removing patched-stamp"
-       @rm -f patched-stamp
+
+unpatch:
+       dpatch deapply-all
+       rm -rf patch-stamp debian/patched       
 
 patched-%: $(patch_dir)/%.dpatch
        @if [ -x $< ]; then true; else chmod +x $<; fi
diff -u spambayes-1.0.4/debian/changelog spambayes-1.0.4/debian/changelog
diff -u spambayes-1.0.4/debian/control spambayes-1.0.4/debian/control
--- spambayes-1.0.4/debian/control
+++ spambayes-1.0.4/debian/control
@@ -2,7 +2,7 @@
 Section: mail
 Priority: optional
 Maintainer: Alexandre Fayolle <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 5.0.37.1)
+Build-Depends: debhelper (>= 5.0.37.1), dpatch
 Build-Depends-Indep: python (>=2.3.5-7), python-dev (>=2.3.5-7), python-central
 Standards-Version: 3.7.3
 XS-Python-Version: current
only in patch2:
unchanged:
--- spambayes-1.0.4.orig/debian/patches/fix_import_future.dpatch
+++ spambayes-1.0.4/debian/patches/fix_import_future.dpatch
@@ -0,0 +1,310 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix_import_future.dpatch updated by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Move all from__future declarations to the start of each file.
+
[EMAIL PROTECTED]@
+diff -urNad spambayes-1.0.4~/Outlook2000/tester.py 
spambayes-1.0.4/Outlook2000/tester.py
+--- spambayes-1.0.4~/Outlook2000/tester.py     2003-12-23 23:08:38.000000000 
-0500
++++ spambayes-1.0.4/Outlook2000/tester.py      2007-09-25 23:35:39.000000000 
-0400
+@@ -1,3 +1,4 @@
++from __future__ import generators
+ # unit tester for the Outlook addin.
+ #
+ # Note we are only attempting to test Outlook specific
+@@ -8,7 +9,6 @@
+ # move this test message back around, and watch the incremental retrain
+ # in action.  Also checks that the message correctly remains classified
+ # after a message move.
+-from __future__ import generators
+ 
+ from win32com.client import constants
+ import sys
+diff -urNad spambayes-1.0.4~/contrib/spamcounts.py 
spambayes-1.0.4/contrib/spamcounts.py
+--- spambayes-1.0.4~/contrib/spamcounts.py     2004-01-12 03:36:15.000000000 
-0500
++++ spambayes-1.0.4/contrib/spamcounts.py      2007-09-25 23:32:23.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #!/usr/bin/env python
++from __future__ import division
+ 
+ """
+ Check spamcounts for various tokens or patterns
+@@ -13,7 +14,6 @@
+         may not be used with -r
+ """
+ 
+-from __future__ import division
+ 
+ import sys
+ import getopt
+diff -urNad spambayes-1.0.4~/contrib/tte.py spambayes-1.0.4/contrib/tte.py
+--- spambayes-1.0.4~/contrib/tte.py    2004-10-15 01:33:53.000000000 -0400
++++ spambayes-1.0.4/contrib/tte.py     2007-09-25 23:33:26.000000000 -0400
+@@ -1,4 +1,5 @@
+ #!/usr/bin/env python
++from __future__ import division
+ 
+ """
+ Train to exhaustion: train repeatedly on a pile of ham and spam until
+@@ -61,7 +62,6 @@
+     http://www.garyrobinson.net/2004/02/spam_filtering_.html
+ """
+ 
+-from __future__ import division
+ 
+ import sys
+ import getopt
+diff -urNad spambayes-1.0.4~/scripts/sb_dbexpimp.py 
spambayes-1.0.4/scripts/sb_dbexpimp.py
+--- spambayes-1.0.4~/scripts/sb_dbexpimp.py    2004-11-22 18:40:29.000000000 
-0500
++++ spambayes-1.0.4/scripts/sb_dbexpimp.py     2007-09-25 23:36:56.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ """sb_dbexpimp.py - Bayes database export/import
+ 
+@@ -90,7 +91,6 @@
+ 
+ __author__ = "Tim Stone <[EMAIL PROTECTED]>"
+ 
+-from __future__ import generators
+ 
+ # Python 2.2 compatibility stuff
+ try:
+diff -urNad spambayes-1.0.4~/scripts/sb_imapfilter.py 
spambayes-1.0.4/scripts/sb_imapfilter.py
+--- spambayes-1.0.4~/scripts/sb_imapfilter.py  2007-09-25 22:39:00.000000000 
-0400
++++ spambayes-1.0.4/scripts/sb_imapfilter.py   2007-09-25 23:38:11.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #!/usr/bin/env python
++from __future__ import generators
+ 
+ """An IMAP filter.  An IMAP message box is scanned and all non-scored
+ messages are scored and (where necessary) filtered.
+@@ -90,7 +91,6 @@
+ __author__ = "Tony Meyer <[EMAIL PROTECTED]>, Tim Stone"
+ __credits__ = "All the Spambayes folk."
+ 
+-from __future__ import generators
+ 
+ try:
+     True, False
+diff -urNad spambayes-1.0.4~/scripts/sb_notesfilter.py 
spambayes-1.0.4/scripts/sb_notesfilter.py
+--- spambayes-1.0.4~/scripts/sb_notesfilter.py 2004-05-02 22:08:13.000000000 
-0400
++++ spambayes-1.0.4/scripts/sb_notesfilter.py  2007-09-25 23:39:33.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ '''sb_notesfilter.py - Lotus Notes Spambayes interface.
+ 
+@@ -133,7 +134,6 @@
+ __author__ = "Tim Stone <[EMAIL PROTECTED]>"
+ __credits__ = "Mark Hammond, for his remarkable win32 modules."
+ 
+-from __future__ import generators
+ 
+ try:
+     True, False
+diff -urNad spambayes-1.0.4~/scripts/sb_pop3dnd.py 
spambayes-1.0.4/scripts/sb_pop3dnd.py
+--- spambayes-1.0.4~/scripts/sb_pop3dnd.py     2004-01-19 12:58:20.000000000 
-0500
++++ spambayes-1.0.4/scripts/sb_pop3dnd.py      2007-09-25 23:39:57.000000000 
-0400
+@@ -1,5 +1,4 @@
+ #!/usr/bin/env python
+-
+ from __future__ import generators
+ 
+ """POP3DND - provides drag'n'drop training ability for POP3 clients.
+diff -urNad spambayes-1.0.4~/spambayes/Corpus.py 
spambayes-1.0.4/spambayes/Corpus.py
+--- spambayes-1.0.4~/spambayes/Corpus.py       2004-04-06 09:21:46.000000000 
-0400
++++ spambayes-1.0.4/spambayes/Corpus.py        2007-09-25 23:42:05.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ '''Corpus.py - Spambayes corpus management framework.
+ 
+@@ -79,8 +80,6 @@
+ __author__ = "Tim Stone <[EMAIL PROTECTED]>"
+ __credits__ = "Richie Hindle, Tim Peters, all the spambayes contributors."
+ 
+-from __future__ import generators
+-
+ try:
+     True, False
+ except NameError:
+diff -urNad spambayes-1.0.4~/spambayes/FileCorpus.py 
spambayes-1.0.4/spambayes/FileCorpus.py
+--- spambayes-1.0.4~/spambayes/FileCorpus.py   2004-04-02 13:10:52.000000000 
-0500
++++ spambayes-1.0.4/spambayes/FileCorpus.py    2007-09-25 23:42:43.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ """FileCorpus.py - Corpus composed of file system artifacts
+ 
+@@ -82,8 +83,6 @@
+ __author__ = "Tim Stone <[EMAIL PROTECTED]>"
+ __credits__ = "Richie Hindle, Tim Peters, all the spambayes contributors."
+ 
+-from __future__ import generators
+-
+ from spambayes import Corpus
+ from spambayes import message
+ from spambayes import storage
+diff -urNad spambayes-1.0.4~/spambayes/TestToolsUI.py 
spambayes-1.0.4/spambayes/TestToolsUI.py
+--- spambayes-1.0.4~/spambayes/TestToolsUI.py  2004-01-30 15:07:40.000000000 
-0500
++++ spambayes-1.0.4/spambayes/TestToolsUI.py   2007-09-25 23:44:36.000000000 
-0400
+@@ -1,3 +1,4 @@
++from __future__ import generators
+ """Testing Tools Web Interface
+ 
+ Classes:
+@@ -20,7 +21,6 @@
+ # The Python Software Foundation and is covered by the Python Software
+ # Foundation license.
+ 
+-from __future__ import generators
+ 
+ __author__ = "Tony Meyer <[EMAIL PROTECTED]>"
+ __credits__ = "All the Spambayes folk."
+diff -urNad spambayes-1.0.4~/spambayes/cdb.py spambayes-1.0.4/spambayes/cdb.py
+--- spambayes-1.0.4~/spambayes/cdb.py  2003-12-11 13:45:07.000000000 -0500
++++ spambayes-1.0.4/spambayes/cdb.py   2007-09-25 23:40:52.000000000 -0400
+@@ -1,4 +1,6 @@
+ #! /usr/bin/env python
++from __future__ import generators
++
+ """
+ Dan Bernstein's CDB implemented in Python
+ 
+@@ -6,7 +8,6 @@
+ 
+ """
+ 
+-from __future__ import generators
+ 
+ import os
+ import struct
+diff -urNad spambayes-1.0.4~/spambayes/classifier.py 
spambayes-1.0.4/spambayes/classifier.py
+--- spambayes-1.0.4~/spambayes/classifier.py   2004-11-09 17:03:27.000000000 
-0500
++++ spambayes-1.0.4/spambayes/classifier.py    2007-09-25 23:41:31.000000000 
-0400
+@@ -1,5 +1,4 @@
+ #! /usr/bin/env python
+-
+ from __future__ import generators
+ 
+ # An implementation of a Bayes-like spam classifier.
+diff -urNad spambayes-1.0.4~/spambayes/mboxutils.py 
spambayes-1.0.4/spambayes/mboxutils.py
+--- spambayes-1.0.4~/spambayes/mboxutils.py    2004-05-04 09:29:34.000000000 
-0400
++++ spambayes-1.0.4/spambayes/mboxutils.py     2007-09-25 23:43:22.000000000 
-0400
+@@ -1,4 +1,6 @@
+ #! /usr/bin/env python
++from __future__ import generators
++
+ """Utilities for dealing with various types of mailboxes.
+ 
+ This is mostly a wrapper around the various useful classes in the
+@@ -18,7 +20,6 @@
+ 
+ """
+ 
+-from __future__ import generators
+ 
+ import os
+ import sys
+diff -urNad spambayes-1.0.4~/spambayes/message.py 
spambayes-1.0.4/spambayes/message.py
+--- spambayes-1.0.4~/spambayes/message.py      2004-12-21 18:12:55.000000000 
-0500
++++ spambayes-1.0.4/spambayes/message.py       2007-09-25 23:43:50.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ """message.py - Core Spambayes classes.
+ 
+@@ -75,8 +76,6 @@
+ __author__ = "Tim Stone <[EMAIL PROTECTED]>"
+ __credits__ = "Mark Hammond, Tony Meyer, all the spambayes contributors."
+ 
+-from __future__ import generators
+-
+ try:
+     True, False
+ except NameError:
+diff -urNad spambayes-1.0.4~/spambayes/tokenizer.py 
spambayes-1.0.4/spambayes/tokenizer.py
+--- spambayes-1.0.4~/spambayes/tokenizer.py    2004-02-12 17:07:55.000000000 
-0500
++++ spambayes-1.0.4/spambayes/tokenizer.py     2007-09-25 23:45:13.000000000 
-0400
+@@ -1,7 +1,7 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ """Module to tokenize email messages for spam filtering."""
+ 
+-from __future__ import generators
+ 
+ import email
+ import email.Message
+diff -urNad spambayes-1.0.4~/testtools/mboxtest.py 
spambayes-1.0.4/testtools/mboxtest.py
+--- spambayes-1.0.4~/testtools/mboxtest.py     2003-01-28 22:23:35.000000000 
-0500
++++ spambayes-1.0.4/testtools/mboxtest.py      2007-09-25 23:46:17.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ """mboxtest.py: A test driver for classifier.
+ 
+ Usage: mboxtest.py [options] <ham> <spam>
+@@ -18,7 +19,6 @@
+         Read no more than MSGS messages from mailbox.
+ """
+ 
+-from __future__ import generators
+ 
+ import getopt
+ import mailbox
+diff -urNad spambayes-1.0.4~/testtools/timcv.py 
spambayes-1.0.4/testtools/timcv.py
+--- spambayes-1.0.4~/testtools/timcv.py        2004-04-07 02:49:04.000000000 
-0400
++++ spambayes-1.0.4/testtools/timcv.py 2007-09-25 23:46:42.000000000 -0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ # A driver for N-fold cross validation.
+ 
+@@ -46,7 +47,6 @@
+ If that exists, it can be used to change the settings in Options.options.
+ """
+ 
+-from __future__ import generators
+ 
+ import os
+ import sys
+diff -urNad spambayes-1.0.4~/testtools/weaktest.py 
spambayes-1.0.4/testtools/weaktest.py
+--- spambayes-1.0.4~/testtools/weaktest.py     2004-01-12 03:36:16.000000000 
-0500
++++ spambayes-1.0.4/testtools/weaktest.py      2007-09-25 23:47:50.000000000 
-0400
+@@ -1,4 +1,5 @@
+ #! /usr/bin/env python
++from __future__ import generators
+ 
+ # A test driver using "the standard" test directory structure.
+ # This simulates a user that gets E-mail, and only trains on fp,
+@@ -29,7 +30,6 @@
+ If that exists, it can be used to change the settings in Options.options.
+ """
+ 
+-from __future__ import generators
+ 
+ import sys,os
+ 
+diff -urNad spambayes-1.0.4~/utilities/pop3graph.py 
spambayes-1.0.4/utilities/pop3graph.py
+--- spambayes-1.0.4~/utilities/pop3graph.py    2004-01-12 03:36:16.000000000 
-0500
++++ spambayes-1.0.4/utilities/pop3graph.py     2007-09-25 23:48:29.000000000 
-0400
+@@ -1,10 +1,10 @@
+ #!/usr/bin/env python
++from __future__ import division
+ 
+ """Analyse the pop3proxy's caches and produce a graph of how accurate
+ classifier has been over time.  Only really meaningful if you started
+ with an empty database."""
+ 
+-from __future__ import division
+ 
+ import sys
+ import getopt

Reply via email to