[Pkg-Cyrus-imapd-Debian-devel] [SVN] r168 - in trunk/cyrus-imapd-2.2.12/debian/patches: 00list 65-sieveshell-enhancements.dpatch

debian at incase.de debian at incase.de
Fri Sep 23 16:55:01 UTC 2005


Author: sven
Date: Fri Sep 23 18:55:00 2005
New Revision: 168

URL: https://mail.incase.de/viewcvs?root=cyrus22?view=rev&rev=168
Log:
Add sieveshell enhancements:
- Add --execfile (-f) parameter to read commands from a file
- Add --password (-p) parameter to allow passing of the users password on commmandline
- Add code to exit with non-zero returncode when the last command run had an error
Added:
    trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch   (with props)
Modified:
    trunk/cyrus-imapd-2.2.12/debian/patches/00list

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/00list
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/00list?view=diff&rev=168&p1=trunk/cyrus-imapd-2.2.12/debian/patches/00list&r1=167&p2=trunk/cyrus-imapd-2.2.12/debian/patches/00list&r2=168
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/00list (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/00list Fri Sep 23 18:55:00 2005
@@ -7,4 +7,5 @@
 50-FTBFS-gcc-4.0-fix.dpatch
 51-multiple_mupdate_err.h-fix.dpatch
 61-64bit-quota.dpatch
+65-sieveshell-enhancements.dpatch
 99-update-autoconf.dpatch

Added: trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch?view=auto&rev=168
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch Fri Sep 23 18:55:00 2005
@@ -1,0 +1,197 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 65-sieveshell-enhancements.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl /tmp/dpep.HDEJ6z/cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl
+--- cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl	2005-05-25 01:02:44.000000000 +0200
++++ /tmp/dpep.HDEJ6z/cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl	2005-09-23 17:09:08.278440120 +0200
+@@ -62,7 +62,9 @@
+ my $username = $ENV{USER};
+ my $authname = $ENV{USER};
+ my $realm = "";
++my $password;
+ my $ex = "";
++my $exfile = "";
+ my $help = 0;
+ my $man = 0;
+ my $ret;
+@@ -70,7 +72,9 @@
+ GetOptions("a|authname:s" => \$authname,
+     "u|username:s" => \$username,
+     "r|realm:s" => \$realm,
++    "p|password:s" => \$password,
+     "e|exec:s" => \$ex,
++    "f|execfile:s" => \$exfile,
+     "help|?" => \$help,
+     man => \$man) or pod2usage(2);
+ pod2usage(1) if $help;
+@@ -85,20 +89,24 @@
+ my $filehandle;
+ my $interactive;
+ 
+-if (! $ex eq "") {
+-    $filehandle = tempfile();
+-
+-    if (!$filehandle) { die "unable to open tmp file: $?"; }
+-
+-    print $filehandle $ex;
+-    seek $filehandle, 0, 0; # rewind file
++if (! $exfile eq "") {
++    open(FILEH,"<$exfile") || die "unable to open file: $?";
++    $filehandle = *FILEH;
+     $interactive = 0;
+ } else {
+-    $filehandle = *STDIN;
+-    $interactive = 1;
+-}
++    if (! $ex eq "") {
++	$filehandle = tempfile();
+ 
++	if (!$filehandle) { die "unable to open tmp file: $?"; }
+ 
++	print $filehandle $ex;
++	seek $filehandle, 0, 0; # rewind file
++	$interactive = 0;
++    } else {
++	$filehandle = *STDIN;
++	$interactive = 1;
++    }
++}
+ 
+ sub list_cb {
+ 
+@@ -123,6 +131,8 @@
+       return $authname;
+   } elsif (($type eq "realm") && (defined $realm)) {
+       return $realm;
++  } elsif (($type eq "password") && (defined $password)) {
++      return $password;
+   }
+ 
+   my $ostty;
+@@ -173,6 +183,8 @@
+ 
+ my $term = Term::ReadLine->new("sieveshell");
+ 
++my $exitcode = 0;
++
+ $term->ornaments(0);
+ 
+ while(defined($_  = ($interactive ? $term->readline('> ') : <$filehandle>))){
+@@ -199,6 +211,9 @@
+ 	my $errstr = sieve_get_error($obj);
+ 	$errstr = "unknown error" if(!defined($errstr));
+ 	print "upload failed: $errstr\n"; 
++	$exitcode = 1;
++      } else {
++        $exitcode = 0;
+       }
+     } elsif (($words[0] eq "list") || 
+ 	     ($words[0] eq "l") || 
+@@ -208,6 +223,9 @@
+ 	    my $errstr = sieve_get_error($obj);
+ 	    $errstr = "unknown error" if(!defined($errstr));
+ 	    print "list failed: $errstr\n";
++	    $exitcode = 1;
++	} else {
++	    $exitcode = 0;
+ 	}
+     } elsif (($words[0] eq "activate") || 
+ 	     ($words[0] eq "a")) {
+@@ -220,6 +238,9 @@
+ 	    my $errstr = sieve_get_error($obj);
+ 	    $errstr = "unknown error" if(!defined($errstr));
+ 	    print "activate failed: $errstr\n";
++	    $exitcode = 1;
++	} else {
++	    $exitcode = 0;
+ 	}
+     } elsif (($words[0] eq "deactivate") || 
+ 	     ($words[0] eq "da")) {
+@@ -232,6 +253,9 @@
+ 	    my $errstr = sieve_get_error($obj);
+ 	    $errstr = "unknown error" if(!defined($errstr));
+ 	    print "deactivate failed: $errstr\n";
++	    $exitcode = 1;
++	} else {
++	    $exitcode = 0;
+ 	}
+     } elsif (($words[0] eq "delete") || 
+ 	     ($words[0] eq "d")) {    
+@@ -244,6 +268,9 @@
+ 	    my $errstr = sieve_get_error($obj);
+ 	    $errstr = "unknown error" if(!defined($errstr));
+ 	    print "delete failed: $errstr\n"; 
++	    $exitcode = 1;
++	} else {
++	    $exitcode = 0;
+ 	}
+     } elsif (($words[0] eq "get") || 
+ 	     ($words[0] eq "g")) {
+@@ -257,25 +284,32 @@
+ 	    my $errstr = sieve_get_error($obj);
+ 	    $errstr = "unknown error" if(!defined($errstr));
+ 	    print "get failed: $errstr\n"; 
++	    $exitcode = 1;
+ 	} else {
+ 	    if ($words[2]) {
+ 		open (OUTPUT,">$words[2]") || die "Unable to open $words[2]";
+ 		print OUTPUT $str;
+ 		close(OUTPUT);
++		$exitcode = 1;
+ 	    } else {
+ 		print $str;
++		$exitcode = 0;
+ 	    }
+ 	}
+     } elsif (($words[0] eq "quit") || ($words[0] eq "q")) {
+         sieve_logout($obj);
+-	exit 0;
++	exit $exitcode;
+     } elsif (($words[0] eq "help") || ($words[0] eq "?")) {
+ 	show_help();
++	$exitcode = 0;
+     } else {
+ 	print "Invalid command: $words[0]\n";
++	$exitcode = 1;
+     } 
+ }
+ 
++exit $exitcode;
++
+ __END__
+ 
+ =head1 NAME
+@@ -285,7 +319,7 @@
+ =head1 SYNOPSIS
+ 
+ sieveshell [B<--user>=I<user>] [B<--authname>=I<authname>] 
+-[B<--realm>=I<realm>] [B<--exec>=I<script>] I<server>[B<:>I<port>]
++[B<--realm>=I<realm>] [B<--password>=I<password>] [B<--exec>=I<script>] [B<--execfile>=I<file>] I<server>[B<:>I<port>]
+ 
+ sieveshell B<--help>
+ 
+@@ -329,11 +363,20 @@
+ 
+ The realm to attempt authentication in.
+ 
++=item B<-p> I<password>, B<--password>=I<password>
++
++The password to use when authenticating to server
++
+ =item B<-e> I<script>, B<--exec>=I<script> 
+ 
+ Instead of working interactively, run commands from I<script>, and
+ exit when done.
+ 
++=item B<-f> I<file>, B<--execfile>=I<file>
++
++Instead of working interactively, run commands from file I<file> and
++exit when done.
++
+ =back
+ 
+ =head1 REFERENCES

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-Cyrus-imapd-Debian-devel mailing list