~ubuntu-branches/ubuntu/lucid/spamassassin/lucid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/06_SA_BUG_5240.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-02-16 21:00:21 UTC
  • Revision ID: james.westby@ubuntu.com-20070216210021-bbxi1xbyfpzaq798
Tags: 3.1.7-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control:
    + libmail-spf-query-perl from Recommends to Depends for spamassassin
      binary
* debian/control: Change Maintainer/XSBC-Original-Maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 06_SA_BUG_5240.dpatch by Duncan Findlay <duncf@debian.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
8
diff -urNad spamassassin~/sa-update.raw spamassassin/sa-update.raw
 
9
--- spamassassin~/sa-update.raw 2006-10-09 13:34:35.000000000 -0400
 
10
+++ spamassassin/sa-update.raw  2007-02-14 23:33:12.000000000 -0500
 
11
@@ -146,6 +146,7 @@
 
12
   'debug|D:s'                           => \$opt{'debug'},
 
13
   'version|V'                           => \$opt{'version'},
 
14
   'help|h|?'                            => \$opt{'help'},
 
15
+  'allowplugins'                        => \$opt{'allowplugins'},
 
16
 
 
17
   # allow multiple of these on the commandline
 
18
   'gpgkey=s'                           => $opt{'gpgkey'},
 
19
@@ -902,9 +903,16 @@
 
20
     if (open OUT, ">".$outfname) {
 
21
       my $content = $tar->get_content($file);
 
22
 
 
23
-      # replace macros in the update files if it's a .pre or .cf
 
24
       if ($outfname =~ /\.(?:pre|cf)$/) {
 
25
+        # replace macros in the update files if it's a .pre or .cf
 
26
         $content =~ s/\@\@([^\@]+)\@\@/$MACRO_VALUES{$1} || "\@\@$1\@\@"/ge;
 
27
+
 
28
+        # also, if --allowplugins is not specified, comment out
 
29
+        # all loadplugin or tryplugin lines
 
30
+        if ( !$opt{'allowplugins'} ) {
 
31
+          $content =~ s{^\s*((?:load|try)plugin|bayes_store_module|auto_whitelist_factory)\b}
 
32
+            {#(commented by sa-update, no --allowplugins switch specified)# $1}gmx;
 
33
+        }
 
34
       }
 
35
 
 
36
       print OUT $content;
 
37
@@ -1230,8 +1238,7 @@
 
38
   --channel channel            Retrieve updates from this channel
 
39
                                Use multiple times for multiple channels
 
40
   --channelfile file           Retrieve updates from the channels in the file
 
41
-
 
42
-
 
43
+  --allowplugins                Allow updates to load plugin code
 
44
   --gpgkey key                 Trust the key id to sign releases
 
45
                                Use multiple times for multiple keys
 
46
   --gpgkeyfile file            Trust the key ids in the file to sign releases
 
47
@@ -1282,6 +1289,12 @@
 
48
 file instead of on the commandline.  This is extremely useful when there are a
 
49
 lot of additional channels.
 
50
 
 
51
+=item B<--allowplugins>
 
52
+
 
53
+Allow downloaded updates to activate plugins.  The default is not to
 
54
+activate plugins; any C<loadplugin> or C<tryplugin> lines will be commented
 
55
+in the downloaded update rules files.
 
56
+
 
57
 =item B<--gpg>, B<--nogpg>
 
58
 
 
59
 sa-update by default will verify update archives by use of a SHA1 checksum