mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib mhamain.pl,2.54,2.55 mhinit.pl,2.43,2.44 mhopt.pl,...

2003-01-02 16:05:17
Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib
In directory subversions:/tmp/cvs-serv5797/lib

Modified Files:
	mhamain.pl mhinit.pl mhopt.pl mhusage.pl 
Log Message:
Added RECONVERT resource.


Index: mhamain.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhamain.pl,v
retrieving revision 2.54
retrieving revision 2.55
diff -C2 -r2.54 -r2.55
*** mhamain.pl	31 Dec 2002 05:03:30 -0000	2.54
--- mhamain.pl	2 Jan 2003 23:04:56 -0000	2.55
***************
*** 277,283 ****
  
      ## Get here, we are processing mail folders
!     my($index, $fields, $fh, $i);
  
!     $i = $NumOfMsgs;
      ##-------------------##
      ## Read mail folders ##
--- 277,283 ----
  
      ## Get here, we are processing mail folders
!     my($index, $fields, $fh, $cur_msg_cnt);
  
!     $cur_msg_cnt = $NumOfMsgs;
      ##-------------------##
      ## Read mail folders ##
***************
*** 297,301 ****
  	if ($index) {
  	    $AddIndex{$index} = 1;
- 	    $IndexNum{$index} = &getNewMsgNum();
  
  	    ## Read rest of message
--- 297,300 ----
***************
*** 344,348 ****
  		    if ($index) {
  			if ($ADD && !$SLOW) { $AddIndex{$index} = 1; }
- 			$IndexNum{$index} = &getNewMsgNum();
  			$Message{$index} = &read_mail_body(
  						$fh,
--- 343,346 ----
***************
*** 353,359 ****
  			if ($SLOW && $DoArchive) {
  			    output_mail($index, 1, 1);
! 			    if (defined($IndexNum{$index})) {
! 				$Update{$IndexNum{$index}} = 1;
! 			    }
  			}
  			if ($SLOW || !$DoArchive) {
--- 351,355 ----
  			if ($SLOW && $DoArchive) {
  			    output_mail($index, 1, 1);
! 			    $Update{$IndexNum{$index}} = 1;
  			}
  			if ($SLOW || !$DoArchive) {
***************
*** 389,393 ****
  		    if ($index) {
  			if ($ADD && !$SLOW) { $AddIndex{$index} = 1; }
- 			$IndexNum{$index} = &getNewMsgNum();
  			$Message{$index} = read_mail_body(
  						$fh,
--- 385,388 ----
***************
*** 397,403 ****
  			if ($SLOW && $DoArchive) {
  			    output_mail($index, 1, 1);
! 			    if (defined($IndexNum{$index})) {
! 				$Update{$IndexNum{$index}} = 1;
! 			    }
  			}
  			if ($SLOW || !$DoArchive) {
--- 392,396 ----
  			if ($SLOW && $DoArchive) {
  			    output_mail($index, 1, 1);
! 			    $Update{$IndexNum{$index}} = 1;
  			}
  			if ($SLOW || !$DoArchive) {
***************
*** 423,431 ****
  
      ## Check if there are any new messages
!     if (!$EDITIDX && ($i == $NumOfMsgs)) {
  	print STDOUT "No new messages\n"  unless $QUIET;
  	return 1;
      }
!     $NewMsgCnt = $NumOfMsgs - $i;
  
      ## Write pages
--- 416,425 ----
  
      ## Check if there are any new messages
!     if (!$EDITIDX && ($cur_msg_cnt > 0) &&
! 	    !scalar(%AddIndex) && !scalar(%Update)) {
  	print STDOUT "No new messages\n"  unless $QUIET;
  	return 1;
      }
!     $NewMsgCnt = $NumOfMsgs - $cur_msg_cnt;
  
      ## Write pages
***************
*** 736,745 ****
  sub read_mail_header {
      my $handle = shift;
!     my($index, $date, $tmp, $i, $field, $value);
      my($from, $sub, $msgid, $ctype);
      local($_);
  
!     my @refs = ();
!     my @array = ();
      my($fields, $header) = readmail::MAILread_file_header($handle);
  
--- 730,741 ----
  sub read_mail_header {
      my $handle = shift;
!     my($date, $tmp, $i, $field, $value);
      my($from, $sub, $msgid, $ctype);
      local($_);
  
!     my $index  = undef;
!     my $msgnum = undef;
!     my @refs   = ();
!     my @array  = ();
      my($fields, $header) = readmail::MAILread_file_header($handle);
  
***************
*** 791,796 ****
  
      ## Return if message already exists in archive
!     if ($msgid && defined($MsgId{$msgid})) {
! 	return undef;
      }
  
--- 787,798 ----
  
      ## Return if message already exists in archive
!     if ($msgid && defined($index = $MsgId{$msgid})) {
! 	if ($Reconvert) {
! 	    $msgnum = $IndexNum{$index};
! 	    delmsg($index);
! 	    $index = undef;
! 	} else {
! 	    return undef;
! 	}
      }
  
***************
*** 891,895 ****
  
      ## Insure uniqueness of index
!     $index .= $X . sprintf("%d",$LastMsgNum+1);
  
      ## Set mhonarc fields.  Note how values are NOT arrays.
--- 893,897 ----
  
      ## Insure uniqueness of index
!     $index .= $X . sprintf('%d',(defined($msgnum)?$msgnum:($LastMsgNum+1)));
  
      ## Set mhonarc fields.  Note how values are NOT arrays.
***************
*** 915,918 ****
--- 917,926 ----
  	$Index2MsgId{$index} = $msgid;
      }
+     if (defined($msgnum)) {
+ 	$IndexNum{$index} = $msgnum;
+ 	++$NumOfMsgs; # Counteract decrement by delmsg
+     } else {
+ 	$IndexNum{$index} = getNewMsgNum();
+     }
  
      $Refs{$index} = [ @refs ]  if (@refs);
***************
*** 1355,1359 ****
  ##
  sub delmsg {
!     my($key) = @_;
      my($pathname);
  
--- 1363,1367 ----
  ##
  sub delmsg {
!     my $key = shift;
      my($pathname);
  

Index: mhinit.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhinit.pl,v
retrieving revision 2.43
retrieving revision 2.44
diff -C2 -r2.43 -r2.44
*** mhinit.pl	2 Jan 2003 04:20:05 -0000	2.43
--- mhinit.pl	2 Jan 2003 23:04:56 -0000	2.44
***************
*** 393,396 ****
--- 393,397 ----
  $DoArchive   = defined($ENV{'M2H_ARCHIVE'})     ? $ENV{'M2H_ARCHIVE'}     : 1;
  $DoFolRefs   = defined($ENV{'M2H_FOLREFS'})     ? $ENV{'M2H_FOLREFS'}     : 1;
+ $Reconvert   = defined($ENV{'M2H_RECONVERT'})   ? $ENV{'M2H_RECONVERT'}   : 0;
  $UsingLASTPG = defined($ENV{'M2H_USINGLASTPG'}) ? $ENV{'M2H_USINGLASTPG'} : 1;
  

Index: mhopt.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhopt.pl,v
retrieving revision 2.47
retrieving revision 2.48
diff -C2 -r2.47 -r2.48
*** mhopt.pl	31 Dec 2002 20:01:37 -0000	2.47
--- mhopt.pl	2 Jan 2003 23:04:56 -0000	2.48
***************
*** 154,157 ****
--- 154,158 ----
  	'quiet',	# No status messages while running
  	'rcfile=s@',	# Resource file for mhonarc
+ 	'reconvert!',	# Reconvert existing messages
  	'varregex=s',	# Regex matching resource variables
  	'reverse',	# List messages in reverse order
***************
*** 269,272 ****
--- 270,275 ----
      $DoArchive	= 1  if $opt{'archive'};
      $DoArchive	= 0  if $opt{'noarchive'};
+ 
+     $Reconvert  = $opt{'reconvert'}  if defined($opt{'reconvert'});
  
      my $dolock	= !$NoArg && !$opt{'nolock'};

Index: mhusage.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhusage.pl,v
retrieving revision 2.20
retrieving revision 2.21
diff -C2 -r2.20 -r2.21
*** mhusage.pl	20 Nov 2002 23:53:12 -0000	2.20
--- mhusage.pl	2 Jan 2003 23:04:56 -0000	2.21
***************
*** 77,81 ****
    -dbfile <name>           : Name of MHonArc database file
    -dbfileperms <octal>     : File permissions for database file
!                              (def: "0660")
    -doc                     : Print link to doc at end of index page
    -docurl <url>            : URL to MHonArc documentation
--- 77,81 ----
    -dbfile <name>           : Name of MHonArc database file
    -dbfileperms <octal>     : File permissions for database file
!                              (def: "0660" -- UMASK is still applied)
    -doc                     : Print link to doc at end of index page
    -docurl <url>            : URL to MHonArc documentation
***************
*** 85,89 ****
    -expireage <secs>        : Time from current when messages expire
    -fileperms <octal>       : File permissions for archive files
!                              (def: "0666")
    -folrefs                 : Print links to follow-ups/references
    -force                   : Perform archive operations even if unable to lock
--- 85,89 ----
    -expireage <secs>        : Time from current when messages expire
    -fileperms <octal>       : File permissions for archive files
!                              (def: "0666" -- UMASK is still applied)
    -folrefs                 : Print links to follow-ups/references
    -force                   : Perform archive operations even if unable to lock
***************
*** 117,120 ****
--- 117,121 ----
    -mhpattern <exp>         : Perl expression for message files in a directory
                               (def: "^\\d+\$")
+   -modifybodyaddresses     : ADDRESSMODIFYCODE applies to text entities
    -modtime                 : Set modification time on files to message date
    -months <list>           : Month names
***************
*** 148,151 ****
--- 149,153 ----
    -noposixstrftime         : Do not use POSIX::strftime() to process time
                               format (the default)
+   -noreconvert             : Do not reconvert existing messages (the default)
    -noreverse               : List messages in normal order (the default)
    -nosaveresources         : Do not save resource values in DB
***************
*** 169,172 ****
--- 171,175 ----
    -quiet                   : Suppress status messages during execution
    -rcfile <file>           : Resource file for MHonArc
+   -reconvert               : Reconvert existing messages
    -reverse                 : List messages in reverse order
    -rmm                     : Remove messages from archive

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV