You can subscribe to this list here.
2003 |
Jan
|
Feb
(160) |
Mar
(119) |
Apr
(111) |
May
(118) |
Jun
(101) |
Jul
(304) |
Aug
(113) |
Sep
(140) |
Oct
(137) |
Nov
(87) |
Dec
(122) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(78) |
Feb
(125) |
Mar
(131) |
Apr
(59) |
May
(121) |
Jun
(166) |
Jul
(150) |
Aug
(137) |
Sep
(73) |
Oct
(58) |
Nov
(27) |
Dec
(60) |
2005 |
Jan
(131) |
Feb
(84) |
Mar
(36) |
Apr
(8) |
May
(28) |
Jun
(20) |
Jul
(10) |
Aug
(72) |
Sep
(76) |
Oct
(34) |
Nov
(3) |
Dec
(29) |
2006 |
Jan
(13) |
Feb
(92) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(17) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(12) |
2007 |
Jan
(28) |
Feb
(15) |
Mar
|
Apr
|
May
(8) |
Jun
(4) |
Jul
(5) |
Aug
(8) |
Sep
(20) |
Oct
(38) |
Nov
(65) |
Dec
(92) |
2008 |
Jan
(21) |
Feb
(56) |
Mar
(27) |
Apr
(174) |
May
(25) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Manni H. <man...@us...> - 2007-11-23 06:59:43
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12914/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Use the more common syntax for the $form hash-ref. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.9 retrieving revision 1.9.4.10 diff -C2 -d -r1.9.4.9 -r1.9.4.10 *** IMAP.pm 19 Nov 2007 14:04:08 -0000 1.9.4.9 --- IMAP.pm 23 Nov 2007 06:59:44 -0000 1.9.4.10 *************** *** 1381,1390 **** # watched folders if ( $name eq 'imap_1_watch_folders' ) { ! if ( defined $$form{update_imap_1_watch_folders} ) { my $i = 1; my %folders; foreach ( $self->watched_folders__() ) { ! $folders{ $$form{"imap_folder_$i"} }++; $i++; } --- 1381,1390 ---- # watched folders if ( $name eq 'imap_1_watch_folders' ) { ! if ( defined $form->{update_imap_1_watch_folders} ) { my $i = 1; my %folders; foreach ( $self->watched_folders__() ) { ! $folders{ $form->{"imap_folder_$i"} }++; $i++; } *************** *** 1398,1402 **** # Add a watched folder if ( $name eq 'imap_2_watch_more_folders' ) { ! if ( defined $$form{imap_2_watch_more_folders} ) { my @current = $self->watched_folders__(); push @current, 'INBOX'; --- 1398,1402 ---- # Add a watched folder if ( $name eq 'imap_2_watch_more_folders' ) { ! if ( defined $form->{imap_2_watch_more_folders} ) { my @current = $self->watched_folders__(); push @current, 'INBOX'; *************** *** 1408,1412 **** # map buckets to folders if ( $name eq 'imap_3_bucket_folders' ) { ! if ( defined $$form{imap_3_bucket_folders} ) { # We have to make sure that there is only one bucket per folder --- 1408,1412 ---- # map buckets to folders if ( $name eq 'imap_3_bucket_folders' ) { ! if ( defined $form->{imap_3_bucket_folders} ) { # We have to make sure that there is only one bucket per folder *************** *** 1421,1425 **** if ( $key =~ /^imap_folder_for_(.+)$/ ) { my $bucket = $1; ! my $folder = $$form{ $key }; $bucket2folder{ $bucket } = $folder; --- 1421,1425 ---- if ( $key =~ /^imap_folder_for_(.+)$/ ) { my $bucket = $1; ! my $folder = $form->{ $key }; $bucket2folder{ $bucket } = $folder; *************** *** 1458,1465 **** if ( $name eq 'imap_5_options' ) { ! if ( defined $$form{update_imap_5_options} ) { # expunge or not? ! if ( defined $$form{imap_options_expunge} ) { $self->config_( 'expunge', 1 ); } --- 1458,1465 ---- if ( $name eq 'imap_5_options' ) { ! if ( defined $form->{update_imap_5_options} ) { # expunge or not? ! if ( defined $form->{imap_options_expunge} ) { $self->config_( 'expunge', 1 ); } *************** *** 1469,1473 **** # update interval ! my $form_interval = $$form{imap_options_update_interval}; if ( defined $form_interval ) { if ( $form_interval > 10 && $form_interval < 60*60 ) { --- 1469,1473 ---- # update interval ! my $form_interval = $form->{imap_options_update_interval}; if ( defined $form_interval ) { if ( $form_interval > 10 && $form_interval < 60*60 ) { *************** *** 1503,1510 **** my $form = shift; ! if ( defined $$form{update_imap_0_connection_details} ) { ! if ( $$form{imap_hostname} ne '' ) { $templ->param( IMAP_connection_if_hostname_error => 0 ); ! $self->config_( 'hostname', $$form{imap_hostname} ); } else { --- 1503,1510 ---- my $form = shift; ! if ( defined $form->{update_imap_0_connection_details} ) { ! if ( $form->{imap_hostname} ne '' ) { $templ->param( IMAP_connection_if_hostname_error => 0 ); ! $self->config_( 'hostname', $form->{imap_hostname} ); } else { *************** *** 1512,1517 **** } ! if ( $$form{imap_port} >= 1 && $$form{imap_port} < 65536 ) { ! $self->config_( 'port', $$form{imap_port} ); $templ->param( IMAP_connection_if_port_error => 0 ); } --- 1512,1517 ---- } ! if ( $form->{imap_port} >= 1 && $form->{imap_port} < 65536 ) { ! $self->config_( 'port', $form->{imap_port} ); $templ->param( IMAP_connection_if_port_error => 0 ); } *************** *** 1520,1525 **** } ! if ( $$form{imap_login} ne '' ) { ! $self->config_( 'login', $$form{imap_login} ); $templ->param( IMAP_connection_if_login_error => 0 ); } --- 1520,1525 ---- } ! if ( $form->{imap_login} ne '' ) { ! $self->config_( 'login', $form->{imap_login} ); $templ->param( IMAP_connection_if_login_error => 0 ); } *************** *** 1528,1533 **** } ! if ( $$form{imap_password} ne '' ) { ! $self->config_( 'password', $$form{imap_password} ); $templ->param( IMAP_connection_if_password_error => 0 ); } --- 1528,1533 ---- } ! if ( $form->{imap_password} ne '' ) { ! $self->config_( 'password', $form->{imap_password} ); $templ->param( IMAP_connection_if_password_error => 0 ); } *************** *** 1536,1540 **** } ! if ( defined $form->{imap_use_ssl} ) { $self->config_( 'use_ssl', 1 ); } --- 1536,1540 ---- } ! if ( $form->{imap_use_ssl} ) { $self->config_( 'use_ssl', 1 ); } |
From: Manni H. <man...@us...> - 2007-11-20 14:25:18
|
Update of /cvsroot/popfile/engine/Services/IMAP In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7442/Services/IMAP Modified Files: Tag: b0_22_2 Client.pm Log Message: Adapt fetch_message_part to gmails broken imap implementation. Index: Client.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP/Attic/Client.pm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Client.pm 11 Nov 2007 16:42:55 -0000 1.1.2.1 --- Client.pm 20 Nov 2007 14:25:14 -0000 1.1.2.2 *************** *** 814,818 **** # trailing and leading newlines and thus omit complete lines. ! while ( $message =~ m/(.*?$eol)/g ) { push @lines, $1; } --- 814,818 ---- # trailing and leading newlines and thus omit complete lines. ! while ( $message =~ m/(.*?(?:$eol|\012|\015))/g ) { push @lines, $1; } *************** *** 820,824 **** # No number of octets: fall back, but issue a warning else { ! while ( $last_response =~ m/(.*?$eol)/g ) { push @lines, $1; } --- 820,824 ---- # No number of octets: fall back, but issue a warning else { ! while ( $last_response =~ m/(.*?(?:$eol|\012|\015))/g ) { push @lines, $1; } |
From: Manni H. <man...@us...> - 2007-11-19 14:04:06
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31353/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Write out the file that contains a retrieved message completely relying on the sys... family of functions: eliminate open, print and seek. The classifier is reading that file handle with sysread and thus we should be using sys... too. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.8 retrieving revision 1.9.4.9 diff -C2 -d -r1.9.4.8 -r1.9.4.9 *** IMAP.pm 18 Nov 2007 11:09:35 -0000 1.9.4.8 --- IMAP.pm 19 Nov 2007 14:04:08 -0000 1.9.4.9 *************** *** 5,8 **** --- 5,9 ---- @ISA = ("POPFile::Module"); use Carp; + use Fcntl; # ---------------------------------------------------------------------------- *************** *** 746,751 **** my $pseudo_mailer; my $file = $self->get_user_path_( 'imap.tmp' ); ! unless ( open $pseudo_mailer, "+>$file" ) { ! $self->log_( 0, "Unable to open temporary file $file. Nothing done to message $msg." ); return; --- 747,753 ---- my $pseudo_mailer; my $file = $self->get_user_path_( 'imap.tmp' ); ! ! unless ( sysopen( $pseudo_mailer, $file, O_RDWR | O_CREAT ) ) { ! $self->log_( 0, "Unable to open temporary file $file. Nothing done to message $msg. ($!)" ); return; *************** *** 760,768 **** # first looking at the parts the message really has. - my @message_parts = qw/HEADER TEXT/; my $imap = $self->{folders__}{$folder}{imap}; PART: ! foreach my $part ( @message_parts ) { my ($ok, @lines ) = $imap->fetch_message_part( $msg, $part ); --- 762,769 ---- # first looking at the parts the message really has. my $imap = $self->{folders__}{$folder}{imap}; PART: ! foreach my $part ( qw/ HEADER TEXT / ) { my ($ok, @lines ) = $imap->fetch_message_part( $msg, $part ); *************** *** 775,779 **** foreach ( @lines ) { ! print $pseudo_mailer "$_"; } --- 776,780 ---- foreach ( @lines ) { ! syswrite $pseudo_mailer, $_; } *************** *** 784,793 **** if ( $part eq 'HEADER' ) { ! seek $pseudo_mailer, 0, 0; ( $class, $slot, $magnet_used ) = $self->classifier()->classify_and_modify( $self->api_session(), $pseudo_mailer, undef, 1, '', undef, 0, undef ); if ( $magnet_used ) { $self->log_( 0, "Message was with slot $slot classified as $class using a magnet." ); ! print $pseudo_mailer "\nThis message was classified based on a magnet.\nThe body of the message was not retrieved from the server.\n"; } else { --- 785,794 ---- if ( $part eq 'HEADER' ) { ! sysseek $pseudo_mailer, 0, 0; ( $class, $slot, $magnet_used ) = $self->classifier()->classify_and_modify( $self->api_session(), $pseudo_mailer, undef, 1, '', undef, 0, undef ); if ( $magnet_used ) { $self->log_( 0, "Message was with slot $slot classified as $class using a magnet." ); ! syswrite $pseudo_mailer, "\nThis message was classified based on a magnet.\nThe body of the message was not retrieved from the server.\n"; } else { *************** *** 799,803 **** # are looking at the complete message. Thus we let the classifier have # a look and make it save the message to history: ! seek $pseudo_mailer, 0, 0; ( $class, $slot, $magnet_used ) = $self->classifier()->classify_and_modify( $self->api_session(), $pseudo_mailer, undef, 0, '', undef, 0, undef ); --- 800,804 ---- # are looking at the complete message. Thus we let the classifier have # a look and make it save the message to history: ! sysseek $pseudo_mailer, 0, 0; ( $class, $slot, $magnet_used ) = $self->classifier()->classify_and_modify( $self->api_session(), $pseudo_mailer, undef, 0, '', undef, 0, undef ); |
From: Brian S. <xue...@us...> - 2007-11-19 10:32:07
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13254 Modified Files: Tag: b0_22_2 installer-SecPOPFile-body.nsh Log Message: "Shutdown POPFile" is an _internet_ shortcut (oops!) Index: installer-SecPOPFile-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-body.nsh,v retrieving revision 1.3.2.14 retrieving revision 1.3.2.15 diff -C2 -d -r1.3.2.14 -r1.3.2.15 *** installer-SecPOPFile-body.nsh 17 Nov 2007 23:39:07 -0000 1.3.2.14 --- installer-SecPOPFile-body.nsh 19 Nov 2007 10:32:10 -0000 1.3.2.15 *************** *** 332,336 **** Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile in background.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" --- 332,336 ---- Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile in background.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" |
From: Manni H. <man...@us...> - 2007-11-19 10:11:45
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5819/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: Finish tests for configure_item Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.5 retrieving revision 1.3.4.6 diff -C2 -d -r1.3.4.5 -r1.3.4.6 *** TestIMAP.tst 18 Nov 2007 11:39:01 -0000 1.3.4.5 --- TestIMAP.tst 19 Nov 2007 10:11:48 -0000 1.3.4.6 *************** *** 30,34 **** # * fail while fetching a part # * fail while fetching_header_fields ! # * configure and validate item # # Client.pm --- 30,34 ---- # * fail while fetching a part # * fail while fetching_header_fields ! # * validate_item # # Client.pm *************** *** 532,536 **** test_assert_equal( $selected, scalar @{$tmpl->param('imap_loop_buckets')} ); ! } --- 532,558 ---- test_assert_equal( $selected, scalar @{$tmpl->param('imap_loop_buckets')} ); ! ! # imap-update-mailbox-list.thtml ! $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); ! test_assert_equal( $tmpl->query( name => 'IMAP_if_connection_configured' ), 'VAR' ); ! $im->config_( 'hostname', '' ); ! $im->configure_item( 'imap_4_update_mailbox_list', $tmpl, $language ); ! test_assert( ! $tmpl->param('IMAP_if_connection_configured' ) ); ! $im->config_( 'hostname', 'test-host' ); ! $im->configure_item( 'imap_4_update_mailbox_list', $tmpl, $language ); ! test_assert( $tmpl->param('IMAP_if_connection_configured' ) ); ! ! # imap-options.thtml ! $tmpl = HTML::Template->new( filename => '../skins/default/imap-options.thtml' ); ! $im->config_( 'expunge', 1 ); ! $im->configure_item( 'imap_5_options', $tmpl, $language ); ! test_assert_equal( $tmpl->param( 'IMAP_expunge_is_checked' ), 'checked="checked"' ); ! ! $im->config_( 'expunge', 0 ); ! $im->config_( 'update_interval', 99 ); ! $im->configure_item( 'imap_5_options', $tmpl, $language ); ! test_assert_equal( $tmpl->param( 'IMAP_expunge_is_checked' ), '' ); ! test_assert_equal( $tmpl->param( 'IMAP_interval', '99' ) ); ! } |
From: Manni H. <man...@us...> - 2007-11-19 09:15:24
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18144/UI Modified Files: Tag: b0_22_2 HTTP.pm Log Message: Log when we open the server socket. Index: HTTP.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTTP.pm,v retrieving revision 1.27.4.2 retrieving revision 1.27.4.3 diff -C2 -d -r1.27.4.2 -r1.27.4.3 *** HTTP.pm 8 Feb 2006 06:49:27 -0000 1.27.4.2 --- HTTP.pm 19 Nov 2007 09:15:27 -0000 1.27.4.3 *************** *** 63,67 **** { my ( $self ) = @_; ! $self->{server_} = IO::Socket::INET->new( Proto => 'tcp', # PROFILE BLOCK START $self->config_( 'local' ) == 1 ? (LocalAddr => 'localhost') : (), --- 63,67 ---- { my ( $self ) = @_; ! $self->log_( 1, "Trying to open listening socket on port " . $self->config_('port') . '.' ); $self->{server_} = IO::Socket::INET->new( Proto => 'tcp', # PROFILE BLOCK START $self->config_( 'local' ) == 1 ? (LocalAddr => 'localhost') : (), |
From: Manni H. <man...@us...> - 2007-11-19 09:13:41
|
Update of /cvsroot/popfile/engine/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17435/Proxy Modified Files: Tag: b0_22_2 Proxy.pm Log Message: Log when we open the server socket. Index: Proxy.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/Proxy.pm,v retrieving revision 1.54.4.2 retrieving revision 1.54.4.3 diff -C2 -d -r1.54.4.2 -r1.54.4.3 *** Proxy.pm 16 Nov 2006 19:06:47 -0000 1.54.4.2 --- Proxy.pm 19 Nov 2007 09:13:43 -0000 1.54.4.3 *************** *** 128,132 **** # Open the socket used to receive request for proxy service ! $self->{server__} = IO::Socket::INET->new( Proto => 'tcp', # PROFILE BLOCK START ($self->config_( 'local' ) || 0) == 1 ? (LocalAddr => 'localhost') : (), --- 128,132 ---- # Open the socket used to receive request for proxy service ! $self->log_( 1, "Opening listening socket on port " . $self->config_('port') . '.' ); $self->{server__} = IO::Socket::INET->new( Proto => 'tcp', # PROFILE BLOCK START ($self->config_( 'local' ) || 0) == 1 ? (LocalAddr => 'localhost') : (), *************** *** 492,497 **** ConnectAddr => $hostname, ConnectPort => $port ); # PROFILE BLOCK STOP ! $self->log_( 0, "Attempting to connect to socks server at " ! . $self->config_( 'socks_server' ) . ":" . ProxyPort => $self->config_( 'socks_port' ) ); } else { --- 492,497 ---- ConnectAddr => $hostname, ConnectPort => $port ); # PROFILE BLOCK STOP ! $self->log_( 0, "Attempting to connect to socks server at " ! . $self->config_( 'socks_server' ) . ":" . ProxyPort => $self->config_( 'socks_port' ) ); } else { *************** *** 502,508 **** PeerAddr => $hostname, PeerPort => $port ); # PROFILE BLOCK STOP ! $self->log_( 0, "Attempting to connect to SSL server at " . "$hostname:$port" ); ! } else { $mail = IO::Socket::INET->new( # PROFILE BLOCK START --- 502,508 ---- PeerAddr => $hostname, PeerPort => $port ); # PROFILE BLOCK STOP ! $self->log_( 0, "Attempting to connect to SSL server at " . "$hostname:$port" ); ! } else { $mail = IO::Socket::INET->new( # PROFILE BLOCK START *************** *** 510,514 **** PeerAddr => $hostname, PeerPort => $port ); # PROFILE BLOCK STOP ! $self->log_( 0, "Attempting to connect to POP server at " . "$hostname:$port" ); } --- 510,514 ---- PeerAddr => $hostname, PeerPort => $port ); # PROFILE BLOCK STOP ! $self->log_( 0, "Attempting to connect to POP server at " . "$hostname:$port" ); } |
From: Manni H. <man...@us...> - 2007-11-18 11:39:01
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10671 Added Files: Tag: b0_22_2 .cvsignore Log Message: More tests for configure_item() --- NEW FILE: .cvsignore --- popfile.cfg |
From: Manni H. <man...@us...> - 2007-11-18 11:39:01
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10671/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: More tests for configure_item() Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.4 retrieving revision 1.3.4.5 diff -C2 -d -r1.3.4.4 -r1.3.4.5 *** TestIMAP.tst 16 Nov 2007 17:06:59 -0000 1.3.4.4 --- TestIMAP.tst 18 Nov 2007 11:39:01 -0000 1.3.4.5 *************** *** 65,69 **** # First, start POPFile. my ( $c, $mq, $l, $b, $w, $h ) = start_popfile(); - my $im = new Services::IMAP; my $session = $b->get_session_key( 'admin', '' ); --- 65,68 ---- *************** *** 73,79 **** configure_imap_module( $im, $c, $mq, $l, $b, $h ); test_imap_ui( $im ); ! # configure_imap_module( $im, $c, $mq, $l, $b, $h ); ! # test_imap_module( $im, $c, $mq, $l, $b, $h ); ! # test_imap_client( $im ); $mq->stop(); --- 72,78 ---- configure_imap_module( $im, $c, $mq, $l, $b, $h ); test_imap_ui( $im ); ! configure_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_client( $im ); $mq->stop(); *************** *** 498,504 **** test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); ! # imap-connection-details.thtml $tmpl = HTML::Template->new( filename => '../skins/default/imap-bucket-folders.thtml' ); test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); } --- 497,535 ---- test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); ! ! # imap-bucket-folders.thtml $tmpl = HTML::Template->new( filename => '../skins/default/imap-bucket-folders.thtml' ); test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); + $im->{mailboxes__} = []; + $im->configure_item( 'imap_3_bucket_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + $im->{mailboxes__} = ['INBOX', 'spam', 'other', 'personal', 'unclassified']; + $im->watched_folders__( 'INBOX' ); + + $im->configure_item( 'imap_3_bucket_folders', $tmpl, $language ); + test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + my $selected = 0; + foreach my $record ( @{$tmpl->param('imap_loop_buckets')} ) { + $record->{IMAP_Bucket_Header} =~ m|<b>(.+)</b>|; + my $bucket = $1; + test_assert( $bucket ); + my $inner_loop = $record->{IMAP_loop_mailboxes}; + test_assert( $inner_loop ); + test_assert_equal( ref $inner_loop, 'ARRAY' ); + + foreach my $inner_record ( @$inner_loop ) { + if ( $inner_record->{IMAP_mailbox} eq $bucket ) { + test_assert_equal( $inner_record->{IMAP_selected}, 'selected="selected"' ); + $selected++; + } + else { + test_assert_equal( $inner_record->{IMAP_selected}, '' ); + } + } + } + test_assert_equal( $selected, 4 ); + test_assert_equal( $selected, scalar @{$tmpl->param('imap_loop_buckets')} ); + } |
From: Manni H. <man...@us...> - 2007-11-18 11:09:32
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32260/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Provide a api_session() method that returns the session key and makes sure that we have one in the first place. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.7 retrieving revision 1.9.4.8 diff -C2 -d -r1.9.4.7 -r1.9.4.8 *** IMAP.pm 13 Nov 2007 10:38:33 -0000 1.9.4.7 --- IMAP.pm 18 Nov 2007 11:09:35 -0000 1.9.4.8 *************** *** 213,218 **** $self->disconnect_folders__(); ! if ( $self->{api_session__} ne '' ) { ! $self->{classifier__}->release_session_key( $self->{api_session__} ); } } --- 213,218 ---- $self->disconnect_folders__(); ! if ( $self->api_session() ne '' ) { ! $self->classifier()->release_session_key( $self->api_session() ); } } *************** *** 235,243 **** if ( time - $self->{last_update__} >= $self->config_( 'update_interval' ) ) { - # Check to see if we have obtained a session key yet - if ( $self->{api_session__} eq '' ) { - $self->{api_session__} = $self->{classifier__}->get_session_key( 'admin', '' ); - } - # Should we use a single or multiple connections? # And did this configuration options change? --- 235,238 ---- *************** *** 355,359 **** # output folders ! foreach my $bucket ( $self->{classifier__}->get_all_buckets( $self->{api_session__} ) ) { my $folder = $self->folder_for_bucket__( $bucket ); --- 350,354 ---- # output folders ! foreach my $bucket ( $self->classifier()->get_all_buckets( $self->api_session() ) ) { my $folder = $self->folder_for_bucket__( $bucket ); *************** *** 414,418 **** ! exists $self->{folders__}{$folder}{watched} && ! $self->{classifier__}->is_pseudo_bucket( $self->{api_session__}, $self->{folders__}{$folder}{output} ) ) { next; --- 409,413 ---- ! exists $self->{folders__}{$folder}{watched} && ! $self->classifier()->is_pseudo_bucket( $self->api_session(), $self->{folders__}{$folder}{output} ) ) { next; *************** *** 507,511 **** ! exists $self->{folders__}{$folder}{watched} && ! $self->{classifier__}->is_pseudo_bucket( $self->{api_session__}, $self->{folders__}{$folder}{output} ) ) { next; --- 502,506 ---- ! exists $self->{folders__}{$folder}{watched} && ! $self->classifier()->is_pseudo_bucket( $self->api_session(), $self->{folders__}{$folder}{output} ) ) { next; *************** *** 790,794 **** if ( $part eq 'HEADER' ) { seek $pseudo_mailer, 0, 0; ! ( $class, $slot, $magnet_used ) = $self->{classifier__}->classify_and_modify( $self->{api_session__}, $pseudo_mailer, undef, 1, '', undef, 0, undef ); if ( $magnet_used ) { --- 785,789 ---- if ( $part eq 'HEADER' ) { seek $pseudo_mailer, 0, 0; ! ( $class, $slot, $magnet_used ) = $self->classifier()->classify_and_modify( $self->api_session(), $pseudo_mailer, undef, 1, '', undef, 0, undef ); if ( $magnet_used ) { *************** *** 806,810 **** seek $pseudo_mailer, 0, 0; ! ( $class, $slot, $magnet_used ) = $self->{classifier__}->classify_and_modify( $self->{api_session__}, $pseudo_mailer, undef, 0, '', undef, 0, undef ); close $pseudo_mailer; --- 801,805 ---- seek $pseudo_mailer, 0, 0; ! ( $class, $slot, $magnet_used ) = $self->classifier()->classify_and_modify( $self->api_session(), $pseudo_mailer, undef, 0, '', undef, 0, undef ); close $pseudo_mailer; *************** *** 891,897 **** my $slot = $self->history()->get_slot_from_hash( $hash ); ! $self->{classifier__}->add_message_to_bucket( $self->{api_session__}, $new_bucket, $file ); ! $self->{classifier__}->reclassified( $self->{api_session__}, $old_bucket, $new_bucket, 0 ); ! $self->history()->change_slot_classification( $slot, $new_bucket, $self->{api_session__}, 0); $self->log_( 0, "Reclassified the message with UID $msg from bucket $old_bucket to bucket $new_bucket." ); --- 886,892 ---- my $slot = $self->history()->get_slot_from_hash( $hash ); ! $self->classifier()->add_message_to_bucket( $self->api_session(), $new_bucket, $file ); ! $self->classifier()->reclassified( $self->api_session(), $old_bucket, $new_bucket, 0 ); ! $self->history()->change_slot_classification( $slot, $new_bucket, $self->api_session(), 0); $self->log_( 0, "Reclassified the message with UID $msg from bucket $old_bucket to bucket $new_bucket." ); *************** *** 1019,1022 **** --- 1014,1035 ---- + # ---------------------------------------------------------------------------- + # + # api_session - Return the API session key and get one if we haven't done so + # already. + # + # ---------------------------------------------------------------------------- + + sub api_session { + my $self = shift; + + if ( ! $self->{api_session__} ) { + $self->{api_session__} = $self->classifier()->get_session_key( 'admin', '' ); + } + + return $self->{api_session__}; + } + + #---------------------------------------------------------------------------- # get hash *************** *** 1283,1287 **** $templ->param( IMAP_if_mailboxes => 1 ); ! my @buckets = $self->{classifier__}->get_all_buckets( $self->{api_session__} ); my @outer_loop = (); --- 1296,1300 ---- $templ->param( IMAP_if_mailboxes => 1 ); ! my @buckets = $self->classifier()->get_all_buckets( $self->api_session() ); my @outer_loop = (); *************** *** 1413,1417 **** # pseudo buckets are free to map wherever they like since # we will never reclassify to them anyway ! unless ( $self->{classifier__}->is_pseudo_bucket( $self->{api_session__}, $bucket ) ) { $folders{ $folder }++; } --- 1426,1430 ---- # pseudo buckets are free to map wherever they like since # we will never reclassify to them anyway ! unless ( $self->classifier()->is_pseudo_bucket( $self->api_session(), $bucket ) ) { $folders{ $folder }++; } *************** *** 1619,1623 **** # Skip pseudobuckets and the INBOX ! next if $self->{classifier__}->is_pseudo_bucket( $self->{api_session__}, $bucket ); next if $folder eq 'INBOX'; --- 1632,1636 ---- # Skip pseudobuckets and the INBOX ! next if $self->classifier()->is_pseudo_bucket( $self->api_session(), $bucket ); next if $folder eq 'INBOX'; *************** *** 1646,1650 **** close $TMP; ! $self->classifier()->add_message_to_bucket( $self->{api_session__}, $bucket, $file ); $self->log_( 0, "Training on the message with UID $msg to bucket $bucket." ); --- 1659,1663 ---- close $TMP; ! $self->classifier()->add_message_to_bucket( $self->api_session(), $bucket, $file ); $self->log_( 0, "Training on the message with UID $msg to bucket $bucket." ); |
From: naoki i. <am...@us...> - 2007-11-18 01:40:07
|
Update of /cvsroot/popfile/windows/languages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23828/languages Modified Files: Tag: b0_22_2 Japanese-pfi.nsh Log Message: Update Japanese transration Index: Japanese-pfi.nsh =================================================================== RCS file: /cvsroot/popfile/windows/languages/Japanese-pfi.nsh,v retrieving revision 1.54.4.10 retrieving revision 1.54.4.11 diff -C2 -d -r1.54.4.10 -r1.54.4.11 *** Japanese-pfi.nsh 20 Oct 2007 06:51:25 -0000 1.54.4.10 --- Japanese-pfi.nsh 18 Nov 2007 01:40:10 -0000 1.54.4.11 *************** *** 176,180 **** !insertmacro PFI_LANG_STRING PFI_LANG_MBMANSHUT_1 "$G_PLS_FIELD_1 ð©®IÉVbg_E·é±ÆªÅ«Ü¹ñŵ½B" !insertmacro PFI_LANG_STRING PFI_LANG_MBMANSHUT_2 "$G_PLS_FIELD_1 ðè®ÅVbg_EµÄº³¢B" ! !insertmacro PFI_LANG_STRING PFI_LANG_MBMANSHUT_3 "$G_PLS_FIELD_1 ðVbg_Eµ½çA'OK' ðNbNµÄ±sµÄº³¢B" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- 176,180 ---- !insertmacro PFI_LANG_STRING PFI_LANG_MBMANSHUT_1 "$G_PLS_FIELD_1 ð©®IÉVbg_E·é±ÆªÅ«Ü¹ñŵ½B" !insertmacro PFI_LANG_STRING PFI_LANG_MBMANSHUT_2 "$G_PLS_FIELD_1 ðè®ÅVbg_EµÄº³¢B" ! !insertmacro PFI_LANG_STRING PFI_LANG_MBMANSHUT_3 "$G_PLS_FIELD_1 ðVbg_Eµ½çAuOKv ðNbNµÄ±sµÄº³¢B" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *************** *** 335,339 **** ; The last line in the summary explains how to change the installation selections ! !insertmacro PFI_LANG_STRING PFI_LANG_SUMMARY_BACKBUTTON "ÝèðÏX·éÉÍA'ßé' {^ÅOÌy[WÉßÁľ³¢B" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- 335,339 ---- ; The last line in the summary explains how to change the installation selections ! !insertmacro PFI_LANG_STRING PFI_LANG_SUMMARY_BACKBUTTON "ÝèðÏX·éÉÍAußév {^ÅOÌy[WÉßÁľ³¢B" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *************** *** 425,429 **** ; Message Box text strings ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBREMDIR_1 "POPFile fBNgȺÌSÄÌt@CðíµÜ·©H${MB_NL}${MB_NL}$G_ROOTDIR${MB_NL}${MB_NL}(cµ½¢t@Cª êÎ ¢¢¦ ðNbNµÄº³¢B)" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- 425,429 ---- ; Message Box text strings ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBREMDIR_1 "POPFile fBNgȺÌSÄÌt@CðíµÜ·©H${MB_NL}${MB_NL}$G_ROOTDIR${MB_NL}${MB_NL}(cµ½¢t@Cª êÎ u¢¢¦v ðNbNµÄº³¢B)" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *************** *** 457,461 **** !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_TITLE "CXg[ÏÝÌ POPFile 0.22 (È~) ðIðµÄ¾³¢" !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_SUBTITLE "SSL T|[gðÇÁ·éÉÍ POPFile ªùÉCXg[³êÄ¢éKvª èÜ·" ! !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_TEXT_TOP "SSL T|[gÍ POPFile ªCXg[³êÄ¢éÌÆ¯¶tH_ÉCXg[·éKvª èÜ·B${MB_NL}${MB_NL}±Ì[eBeBÍÌtH_ÉCXg[³êÄ¢é POPFile É SSL T|[gðÇÁµÜ·BÙÈé POPFile ÉεÄÇÁµ½¢ÈçA'QÆ' {^ðµÄÊÌtH_ðIðµÄ¾³¢B $_CLICK" !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_TEXT_DESTN "POPFile 0.22 (È~) ªCXg[³êÄ¢étH_" --- 457,461 ---- !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_TITLE "CXg[ÏÝÌ POPFile 0.22 (È~) ðIðµÄ¾³¢" !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_SUBTITLE "SSL T|[gðÇÁ·éÉÍ POPFile ªùÉCXg[³êÄ¢éKvª èÜ·" ! !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_TEXT_TOP "SSL T|[gÍ POPFile ªCXg[³êÄ¢éÌÆ¯¶tH_ÉCXg[·éKvª èÜ·B${MB_NL}${MB_NL}±Ì[eBeBÍÌtH_ÉCXg[³êÄ¢é POPFile É SSL T|[gðÇÁµÜ·BÙÈé POPFile ÉεÄÇÁµ½¢ÈçAuQÆv {^ðµÄÊÌtH_ðIðµÄ¾³¢B $_CLICK" !insertmacro PFI_LANG_STRING PSS_LANG_DESTNDIR_TEXT_DESTN "POPFile 0.22 (È~) ªCXg[³êÄ¢étH_" *************** *** 493,497 **** !insertmacro PFI_LANG_STRING PSS_LANG_FINISH_TITLE "$(^NameDA) EBU[h®¹" ! !insertmacro PFI_LANG_STRING PSS_LANG_FINISH_TEXT "POPFile Ì SSL T|[gªCXg[³êܵ½B${IO_NL}${IO_NL}POPFile ðN®µAPOPFile Æ[\tgÆð SSL ªgpū鿤ÉÝèµÄ¾³¢B${IO_NL}${IO_NL}'®¹' {^ðµÄEBU[hð¶ľ³¢B" !insertmacro PFI_LANG_STRING PSS_LANG_FINISH_README "dvÈîñ" --- 493,497 ---- !insertmacro PFI_LANG_STRING PSS_LANG_FINISH_TITLE "$(^NameDA) EBU[h®¹" ! !insertmacro PFI_LANG_STRING PSS_LANG_FINISH_TEXT "POPFile Ì SSL T|[gªCXg[³êܵ½B${IO_NL}${IO_NL}POPFile ðN®µAPOPFile Æ[\tgÆð SSL ªgpū鿤ÉÝèµÄ¾³¢B${IO_NL}${IO_NL}u®¹v {^ðµÄEBU[hð¶ľ³¢B" !insertmacro PFI_LANG_STRING PSS_LANG_FINISH_README "dvÈîñ" *************** *** 629,633 **** ; Installation Progress Reports displayed above the progress bar ! !insertmacro PFI_LANG_STRING PFI_LANG_INST_PROG_CORPUS "corpus(R[pXAPêt@C)ÌobNAbvðì¬BµÎç¨Ò¿º³¢..." !insertmacro PFI_LANG_STRING PFI_LANG_INST_PROG_SQLBACKUP "â SQLite f[^x[XðobNAbv..." !insertmacro PFI_LANG_STRING PFI_LANG_INST_PROG_FINDCORPUS "tbgt@CÜ½Í BerkeleyDB ÌR[pXðTµÄ¢Ü·..." --- 629,633 ---- ; Installation Progress Reports displayed above the progress bar ! !insertmacro PFI_LANG_STRING PFI_LANG_INST_PROG_CORPUS "R[pX(Pêt@C)ÌobNAbvðì¬BµÎç¨Ò¿º³¢..." !insertmacro PFI_LANG_STRING PFI_LANG_INST_PROG_SQLBACKUP "â SQLite f[^x[XðobNAbv..." !insertmacro PFI_LANG_STRING PFI_LANG_INST_PROG_FINDCORPUS "tbgt@CÜ½Í BerkeleyDB ÌR[pXðTµÄ¢Ü·..." *************** *** 647,651 **** !insertmacro PFI_LANG_STRING PFI_LANG_MBSTPWDS_D "ât@Cðc·ÉÍu¢¢¦vðNbNµÄº³¢B(Vµ¢t@CÍ̼OÅÛ¶³êÜ·: 'stopwords.default')" ! !insertmacro PFI_LANG_STRING PFI_LANG_MBCORPUS_1 "â corpus ðobNAbvÉG[ª©Â©èܵ½B" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- 647,651 ---- !insertmacro PFI_LANG_STRING PFI_LANG_MBSTPWDS_D "ât@Cðc·ÉÍu¢¢¦vðNbNµÄº³¢B(Vµ¢t@CÍ̼OÅÛ¶³êÜ·: 'stopwords.default')" ! !insertmacro PFI_LANG_STRING PFI_LANG_MBCORPUS_1 "â R[pX ðobNAbvÉG[ª©Â©èܵ½B" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *************** *** 854,858 **** ; Message Box to confirm changes to Outlook/Outlook Express account configuration ! !insertmacro PFI_LANG_STRING PFI_LANG_EXPCFG_MBIDENTITY "Outlook Express ACfeBeB[ :" !insertmacro PFI_LANG_STRING PFI_LANG_EXPCFG_MBACCOUNT "Outlook Express AJEg :" --- 854,858 ---- ; Message Box to confirm changes to Outlook/Outlook Express account configuration ! !insertmacro PFI_LANG_STRING PFI_LANG_EXPCFG_MBIDENTITY "Outlook Express [U[ :" !insertmacro PFI_LANG_STRING PFI_LANG_EXPCFG_MBACCOUNT "Outlook Express AJEg :" *************** *** 984,988 **** !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_OUTLOOK "Outlook ÌÝèð³ÉߵĢܷ..." !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_EUDORA "Eudora ÌÝèð³ÉߵĢܷ..." ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_DBMSGDIR "corpus Æ 'Recent Messages' fBNgðí..." !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_CONFIG "Ýèf[^ðí..." !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_EXESTATUS "vOÌXe[^Xð`FbN..." --- 984,988 ---- !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_OUTLOOK "Outlook ÌÝèð³ÉߵĢܷ..." !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_EUDORA "Eudora ÌÝèð³ÉߵĢܷ..." ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_DBMSGDIR "R[pX Æ 'ÅßÌbZ[W' fBNgðí..." !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_CONFIG "Ýèf[^ðí..." !insertmacro PFI_LANG_STRING PFI_LANG_UN_PROG_EXESTATUS "vOÌXe[^Xð`FbN..." *************** *** 1014,1023 **** !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_1 "¢Â©Ì[NCAgÌÝèð³Éß·±ÆªÅ«Ü¹ñŵ½I" !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_2 "(Ú×É¢ÄÍ $INSTDIR tH_ðQƵľ³¢B)" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_3 "'¢¢¦' ðNbN·êÎG[ð³µÄSÄðíµÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_4 "'Í¢' ðNbN·êÎf[^ÍÛ¶³êÜ·B(±êÍAãÅܽÄs·é̽ßÅ·B)" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBREMDIR_2 "POPFileu[U[f[^vfBNgȺÌSÄÌt@CðíµÜ·©H${MB_NL}${MB_NL}$G_USERDIR${MB_NL}${MB_NL}(cµ½¢t@Cª êÎ ¢¢¦ ðNbNµÄº³¢B)" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBDELMSGS_1 "'Recent Messages' fBNgÌSÄÌt@CðíµÜ·©H" ########################################################################### --- 1014,1023 ---- !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_1 "¢Â©Ì[NCAgÌÝèð³Éß·±ÆªÅ«Ü¹ñŵ½I" !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_2 "(Ú×É¢ÄÍ $INSTDIR tH_ðQƵľ³¢B)" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_3 "u¢¢¦v ðNbN·êÎG[ð³µÄSÄðíµÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBRERUN_4 "uÍ¢v ðNbN·êÎf[^ÍÛ¶³êÜ·B(±êÍAãÅܽÄs·é̽ßÅ·B)" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBREMDIR_2 "POPFile [U[f[^ fBNgȺÌSÄÌt@CðíµÜ·©H${MB_NL}${MB_NL}$G_USERDIR${MB_NL}${MB_NL}(cµ½¢t@Cª êÎ u¢¢¦v ðNbNµÄº³¢B)" ! !insertmacro PFI_LANG_STRING PFI_LANG_UN_MBDELMSGS_1 "'ÅßÌbZ[W' fBNgÌSÄÌt@CðíµÜ·©H" ########################################################################### *************** *** 1028,1046 **** ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_TITLE "POPFile Corpus(R[pXAPêt@C)ÌÏ·" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_SUBTITLE "CXg[µæ¤ÆµÄ¢éo[WÌ POPFile Æ®ì·é½ßÉÍA¡ é corpus ðÏ··éKvª èÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_ENDCONVERT_TITLE "POPFile Corpus ÌÏ·Í®¹µÜµ½B" !insertmacro PFI_LANG_STRING PFI_LANG_ENDCONVERT_SUBTITLE "±s·éÉÍu¶évðNbNµÄº³¢B" ! !insertmacro PFI_LANG_STRING PFI_LANG_BADCONVERT_TITLE "POPFile Corpus ÌϷɸsµÜµ½B" !insertmacro PFI_LANG_STRING PFI_LANG_BADCONVERT_SUBTITLE "±s·éÉÍuLZvðNbNµÄº³¢B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_MUTEX "ÊÌ 'Corpus Conversion Monitor' ªùÉN®Å·I" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_PRIVATE "'Corpus Conversion Monitor' Í POPFile CXg[[ÌêÅ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_NOFILE "G[: Corpus Ï·f[^t@Cª¶ÝµÜ¹ñI" !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_NOPOPFILE "G[: POPFile ÌpXª©Â©èܹñB" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_STARTERR "Corpus Ï·ÌvZXðN®ÉG[ª¶µÜµ½B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_FATALERR "Corpus Ï·ÌvZXÉv½IÈG[ª¶µÜµ½I" !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_ESTIMATE "\zcèÔ: " !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_MINUTES "ª" --- 1028,1046 ---- ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_TITLE "POPFile R[pX(Pêt@C)ÌÏ·" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_SUBTITLE "CXg[µæ¤ÆµÄ¢éo[WÌ POPFile ª®ì·é½ßÉÍA¡ é R[pX ðÏ··éKvª èÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_ENDCONVERT_TITLE "POPFile R[pXÌÏ·Í®¹µÜµ½B" !insertmacro PFI_LANG_STRING PFI_LANG_ENDCONVERT_SUBTITLE "±s·éÉÍu¶évðNbNµÄº³¢B" ! !insertmacro PFI_LANG_STRING PFI_LANG_BADCONVERT_TITLE "POPFile R[pXÌϷɸsµÜµ½B" !insertmacro PFI_LANG_STRING PFI_LANG_BADCONVERT_SUBTITLE "±s·éÉÍuLZvðNbNµÄº³¢B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_MUTEX "ÊÌ 'R[pXÏ·j^' ªùÉN®Å·I" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_PRIVATE "'R[pXÏ·j^' Í POPFile CXg[[ÌêÅ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_NOFILE "G[: R[pXÏ·f[^t@Cª¶ÝµÜ¹ñI" !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_NOPOPFILE "G[: POPFile ÌpXª©Â©èܹñB" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_STARTERR "R[pXÏ·ÌvZXðN®ÉG[ª¶µÜµ½B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_FATALERR "R[pXÏ·ÌvZXÉv½IÈG[ª¶µÜµ½I" !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_ESTIMATE "\zcèÔ: " !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_MINUTES "ª" *************** *** 1048,1053 **** !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_TOTALFILES "$G_BUCKET_COUNT ÂÌoPct@CðÏ·µÜ·B" !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_PROGRESS_N "$G_ELAPSED_TIME.$G_DECPLACES ªoßB Æ $G_STILL_TO_DO ÂÌt@CðÏ·µÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_PROGRESS_1 "$G_ELAPSED_TIME.$G_DECPLACES ªoßB Æ1ÂÌt@CðÏ·µÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_SUMMARY "Corpus ÌÏ·ÉÍ $G_ELAPSED_TIME.$G_DECPLACES ª©©èܵ½B" ########################################################################### --- 1048,1053 ---- !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_TOTALFILES "$G_BUCKET_COUNT ÂÌoPct@CðÏ·µÜ·B" !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_PROGRESS_N "$G_ELAPSED_TIME.$G_DECPLACES ªoßB Æ $G_STILL_TO_DO ÂÌt@CðÏ·µÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_PROGRESS_1 "$G_ELAPSED_TIME.$G_DECPLACES ªoßB Æ 1 ÂÌt@CðÏ·µÜ·B" ! !insertmacro PFI_LANG_STRING PFI_LANG_CONVERT_SUMMARY "R[pXÌÏ·ÉÍ $G_ELAPSED_TIME.$G_DECPLACES ª©©èܵ½B" ########################################################################### |
From: Brian S. <xue...@us...> - 2007-11-17 23:39:07
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12134 Modified Files: Tag: b0_22_2 adduser-Uninstall.nsh adduser-Version.nsh adduser.nsi installer-SecPOPFile-body.nsh installer-Uninstall.nsh installer.nsi Log Message: Remove obsolete Start Menu entries when upgrading an earlier release. When uninstalling only remove Start Menu entries which refer to the files being removed. Reduce the interference caused when uninstalling the program files before the User Data files. Index: installer-SecPOPFile-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-body.nsh,v retrieving revision 1.3.2.13 retrieving revision 1.3.2.14 diff -C2 -d -r1.3.2.13 -r1.3.2.14 *** installer-SecPOPFile-body.nsh 13 Nov 2007 22:56:00 -0000 1.3.2.13 --- installer-SecPOPFile-body.nsh 17 Nov 2007 23:39:07 -0000 1.3.2.14 *************** *** 324,342 **** ; Attempt to remove some StartUp and Start Menu shortcuts created by previous installations SetShellVarContext all ! Delete "$SMSTARTUP\Run POPFile.lnk" ! Delete "$SMSTARTUP\Run POPFile in background.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile in background.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Manual.url" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Manual.url" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" SetShellVarContext current ! Delete "$SMSTARTUP\Run POPFile.lnk" ! Delete "$SMSTARTUP\Run POPFile in background.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile in background.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Manual.url" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Manual.url" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" ; Create the START MENU entries --- 324,348 ---- ; Attempt to remove some StartUp and Start Menu shortcuts created by previous installations + !macro OBSOLETE_START_MENU_ENTRIES + + Delete "$SMSTARTUP\Run POPFile.lnk" + Delete "$SMSTARTUP\Run POPFile in background.lnk" + + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Manual.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile in background.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" + + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Manual.url" + + !macroend + SetShellVarContext all ! !insertmacro OBSOLETE_START_MENU_ENTRIES SetShellVarContext current ! !insertmacro OBSOLETE_START_MENU_ENTRIES ; Create the START MENU entries Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.17 retrieving revision 1.242.4.18 diff -C2 -d -r1.242.4.17 -r1.242.4.18 *** installer.nsi 13 Nov 2007 22:58:10 -0000 1.242.4.17 --- installer.nsi 17 Nov 2007 23:39:08 -0000 1.242.4.18 *************** *** 886,889 **** --- 886,890 ---- ReserveFile "${NSISDIR}\Plugins\md5dll.dll" ReserveFile "${NSISDIR}\Plugins\NSISdl.dll" + ReserveFile "${NSISDIR}\Plugins\ShellLink.dll" ReserveFile "${NSISDIR}\Plugins\System.dll" ReserveFile "${NSISDIR}\Plugins\UAC.dll" Index: adduser-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-Uninstall.nsh,v retrieving revision 1.2.2.7 retrieving revision 1.2.2.8 diff -C2 -d -r1.2.2.7 -r1.2.2.8 *** adduser-Uninstall.nsh 10 Nov 2007 13:43:08 -0000 1.2.2.7 --- adduser-Uninstall.nsh 17 Nov 2007 23:39:07 -0000 1.2.2.8 *************** *** 478,493 **** ; Remove the POPFile shortcuts from the current user's Start Menu Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Message Capture utility.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Check database status.lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" Call un.PFI_IsNT Pop ${L_TEMP} ! StrCmp ${L_TEMP} 1 remove_all IfFileExists "$G_ROOTDIR\uninstall.exe" remove_most ! remove_all: Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Release Notes.lnk" --- 478,517 ---- ; Remove the POPFile shortcuts from the current user's Start Menu + SetShellVarContext all + StrCpy ${L_TEMP} "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\" + SetShellVarContext current + StrCmp ${L_TEMP} "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\" 0 remove_all_support + + IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" 0 try_full + ShellLink::GetShortCutTarget "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" + Pop ${L_TEMP} + IfFileExists "${L_TEMP}" skip_system_entries + + try_full: + IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" 0 remove_all_support + ShellLink::GetShortCutTarget "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" + Pop ${L_TEMP} + IfFileExists "${L_TEMP}" skip_system_entries + + remove_all_support: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" + + skip_system_entries: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Check database status.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Message Capture utility.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" Call un.PFI_IsNT Pop ${L_TEMP} ! StrCmp ${L_TEMP} 1 remove_all_main IfFileExists "$G_ROOTDIR\uninstall.exe" remove_most ! remove_all_main: ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Release Notes.lnk" Index: installer-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-Uninstall.nsh,v retrieving revision 1.4.2.15 retrieving revision 1.4.2.16 diff -C2 -d -r1.4.2.15 -r1.4.2.16 *** installer-Uninstall.nsh 13 Nov 2007 22:58:10 -0000 1.4.2.15 --- installer-Uninstall.nsh 17 Nov 2007 23:39:07 -0000 1.4.2.16 *************** *** 694,704 **** #-------------------------------------------------------------------------- Section "-un.Start Menu Entries" UnSecStartMenu StrCmp $G_UNINST_MODE "change" skip_section ! !define L_TEMP $R9 ! Push ${L_TEMP} SetDetailsPrint textonly --- 694,716 ---- #-------------------------------------------------------------------------- + !macro CHECK_SHORTCUT_TARGET SHORTCUT_FILE EXPECTED_TARGET + + !insertmacro PFI_UNIQUE_ID + + IfFileExists "${SHORTCUT_FILE}" 0 try_next_${PFI_UNIQUE_ID} + ShellLink::GetShortCutTarget "${SHORTCUT_FILE}" + Pop ${L_TARGET} + StrCmp ${L_TARGET} "${EXPECTED_TARGET}" delete_menu_entries + + try_next_${PFI_UNIQUE_ID}: + !macroend + Section "-un.Start Menu Entries" UnSecStartMenu StrCmp $G_UNINST_MODE "change" skip_section ! !define L_TARGET $R9 ! Push ${L_TARGET} SetDetailsPrint textonly *************** *** 706,739 **** SetDetailsPrint listonly SetShellVarContext all - StrCmp $G_WINUSERTYPE "Admin" menucleanup - SetShellVarContext current ! menucleanup: ! IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" 0 delete_menu_entries ! ReadINIStr ${L_TEMP} "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" \ ! "InternetShortcut" "URL" ! StrCmp ${L_TEMP} "file://$G_ROOTDIR/manual/en/manual.html" delete_menu_entries exit delete_menu_entries: Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Release Notes.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile in background.lnk" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" - - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\QuickStart Guide.url" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" - Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" - - Delete "$SMSTARTUP\Run POPFile in background.lnk" - Delete "$SMSTARTUP\Run POPFile.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" --- 718,765 ---- SetDetailsPrint listonly + ; The UAC plugin ensures we have admin rights + SetShellVarContext all ! ; Check if the Start Menu shortcuts refer to the installation we are removing ! ; (if they don't then leave them alone) ! ! !insertmacro CHECK_SHORTCUT_TARGET \ ! "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" \ ! "$G_ROOTDIR\runpopfile.exe" ! ! !insertmacro CHECK_SHORTCUT_TARGET \ ! "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" \ ! "$G_ROOTDIR\uninstall.exe" ! ! !insertmacro CHECK_SHORTCUT_TARGET \ ! "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" ! ! !insertmacro CHECK_SHORTCUT_TARGET \ ! "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" ! ! Goto exit delete_menu_entries: + SetShellVarContext current + StrCpy ${L_TARGET} "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\" + SetShellVarContext all + StrCmp ${L_TARGET} "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\" 0 remove_all + IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" skip_site_entries + + remove_all: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" + + skip_site_entries: Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Release Notes.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" *************** *** 750,756 **** SetDetailsPrint listonly ! Pop ${L_TEMP} ! !undef L_TEMP skip_section: --- 776,782 ---- SetDetailsPrint listonly ! Pop ${L_TARGET} ! !undef L_TARGET skip_section: Index: adduser-Version.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-Version.nsh,v retrieving revision 1.6.2.17 retrieving revision 1.6.2.18 diff -C2 -d -r1.6.2.17 -r1.6.2.18 *** adduser-Version.nsh 10 Nov 2007 13:43:08 -0000 1.6.2.17 --- adduser-Version.nsh 17 Nov 2007 23:39:07 -0000 1.6.2.18 *************** *** 7,11 **** #-------------------------------------------------------------------------- ! !define C_PFI_VERSION "0.3.17" #-------------------------------------------------------------------------- --- 7,11 ---- #-------------------------------------------------------------------------- ! !define C_PFI_VERSION "0.3.18" #-------------------------------------------------------------------------- Index: adduser.nsi =================================================================== RCS file: /cvsroot/popfile/windows/adduser.nsi,v retrieving revision 1.59.4.19 retrieving revision 1.59.4.20 diff -C2 -d -r1.59.4.19 -r1.59.4.20 *** adduser.nsi 10 Nov 2007 13:43:08 -0000 1.59.4.19 --- adduser.nsi 17 Nov 2007 23:39:07 -0000 1.59.4.20 *************** *** 727,730 **** --- 727,731 ---- ReserveFile "${NSISDIR}\Plugins\nsExec.dll" ReserveFile "${NSISDIR}\Plugins\NSISdl.dll" + ReserveFile "${NSISDIR}\Plugins\ShellLink.dll" ReserveFile "${NSISDIR}\Plugins\System.dll" ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" *************** *** 1215,1220 **** --- 1216,1267 ---- "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/shutdown" + SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" NORMAL + + !ifndef ENGLISH_MODE + StrCmp $LANGUAGE ${LANG_JAPANESE} japanese_faq + !endif + + WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" \ + "InternetShortcut" "URL" \ + "http://getpopfile.org/wiki/FAQ" + + !ifndef ENGLISH_MODE + Goto support + + japanese_faq: + WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" \ + "InternetShortcut" "URL" \ + "http://getpopfile.org/wiki/JP:FAQ" + + support: + !endif + SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" + SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" NORMAL + WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" \ + "InternetShortcut" "URL" "http://getpopfile.org/" + + SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" NORMAL + + !ifndef ENGLISH_MODE + StrCmp $LANGUAGE ${LANG_JAPANESE} japanese_wiki + !endif + + WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" \ + "InternetShortcut" "URL" \ + "http://getpopfile.org/wiki" + + !ifndef ENGLISH_MODE + Goto user_data_shortcut + + japanese_wiki: + WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" \ + "InternetShortcut" "URL" \ + "http://getpopfile.org/wiki/jp" + + user_data_shortcut: + !endif + IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" 0 pfidiag_entries SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" NORMAL *************** *** 1225,1234 **** IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 msgcapture_entry Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" ! ; SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL ! ; CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! ; "$G_ROOTDIR\pfidiag.exe" ! ; SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" NORMAL ! ; CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! ; "$G_ROOTDIR\pfidiag.exe" "/full" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" \ --- 1272,1281 ---- IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 msgcapture_entry Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" "/full" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" \ |
From: Manni H. <man...@us...> - 2007-11-16 17:06:59
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15454/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: Even more tests for the UI. Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.3 retrieving revision 1.3.4.4 diff -C2 -d -r1.3.4.3 -r1.3.4.4 *** TestIMAP.tst 16 Nov 2007 10:11:20 -0000 1.3.4.3 --- TestIMAP.tst 16 Nov 2007 17:06:59 -0000 1.3.4.4 *************** *** 73,79 **** configure_imap_module( $im, $c, $mq, $l, $b, $h ); test_imap_ui( $im ); ! configure_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_client( $im ); $mq->stop(); --- 73,79 ---- configure_imap_module( $im, $c, $mq, $l, $b, $h ); test_imap_ui( $im ); ! # configure_imap_module( $im, $c, $mq, $l, $b, $h ); ! # test_imap_module( $im, $c, $mq, $l, $b, $h ); ! # test_imap_client( $im ); $mq->stop(); *************** *** 429,441 **** # Finally, both get a value ! $im->{mailboxes__} = [1]; ! $im->watched_folders__( 'second' ); $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); - my %params = map { $_ => 1 } $tmpl->param('IMAP_loop_watched_folders'); - #use Data::Dumper; warn Dumper( \%params ); - test_assert_equal( 1, 1 ); --- 429,486 ---- # Finally, both get a value ! $im->{mailboxes__} = ['INBOX','something', 'other', 'second']; ! $im->watched_folders__( 'INBOX', 'second' ); $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + # This should be an arrayref containing a hash for each + # iteration of the loop, ie for each watched folder + my $params = $tmpl->param('IMAP_loop_watched_folders'); + # since we have two watched folders, we should have to elements + # in our params array + test_assert_equal( scalar @$params, 2 ); + + my $inner_loop = $params->[0]->{IMAP_loop_mailboxes}; + # since we have four mailboxes, this inner loop should have + # four elements + test_assert_equal( scalar @$inner_loop, 4 ); + my %included_mailboxes = (); + foreach ( @$inner_loop ) { + $included_mailboxes{ $_->{IMAP_mailbox} } = 1; + if ( $_->{IMAP_mailbox} eq 'INBOX' ) { + test_assert_equal( $_->{IMAP_selected}, 'selected="selected"' ); + } + else { + test_assert_equal( $_->{IMAP_selected}, '' ); + } + } + test_assert_equal( scalar keys %included_mailboxes, 4 ); + foreach ( @{$im->{mailboxes__}} ) { + test_assert_equal( $included_mailboxes{ $_ }, 1 ); + } + + # and the same for the second watched folder: + $inner_loop = $params->[1]->{IMAP_loop_mailboxes}; + # since we have four mailboxes, this inner loop should have + # four elements + test_assert_equal( scalar @$inner_loop, 4 ); + %included_mailboxes = (); + foreach ( @$inner_loop ) { + $included_mailboxes{ $_->{IMAP_mailbox} } = 1; + if ( $_->{IMAP_mailbox} eq 'second' ) { + test_assert_equal( $_->{IMAP_selected}, 'selected="selected"' ); + } + else { + test_assert_equal( $_->{IMAP_selected}, '' ); + } + } + test_assert_equal( scalar keys %included_mailboxes, 4 ); + foreach ( @{$im->{mailboxes__}} ) { + test_assert_equal( $included_mailboxes{ $_ }, 1 ); + } + + test_assert_equal( $params->[0]->{IMAP_loop_counter}, 1 ); + test_assert_equal( $params->[1]->{IMAP_loop_counter}, 2 ); *************** *** 453,457 **** test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); ! } --- 498,504 ---- test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); ! # imap-connection-details.thtml ! $tmpl = HTML::Template->new( filename => '../skins/default/imap-bucket-folders.thtml' ); ! test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); } |
From: Manni H. <man...@us...> - 2007-11-16 10:11:20
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26789/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: Yet more tests: first tests for configure_item Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -C2 -d -r1.3.4.2 -r1.3.4.3 *** TestIMAP.tst 11 Nov 2007 16:42:54 -0000 1.3.4.2 --- TestIMAP.tst 16 Nov 2007 10:11:20 -0000 1.3.4.3 *************** *** 42,48 **** --- 42,50 ---- use POPFile::History; use Services::IMAP; + use UI::HTML; use Classifier::Bayes; use Classifier::WordMangle; use File::Copy; + use HTML::Template; $SIG{CHLD} = 'IGNORE'; *************** *** 70,73 **** --- 72,77 ---- # talk to the server. configure_imap_module( $im, $c, $mq, $l, $b, $h ); + test_imap_ui( $im ); + configure_imap_module( $im, $c, $mq, $l, $b, $h ); test_imap_module( $im, $c, $mq, $l, $b, $h ); test_imap_client( $im ); *************** *** 344,347 **** --- 348,459 ---- } + ################################################################################# + # test_imap_ui + # Test the UI widgets of the IMAP module. All we are going to have to do + # here is test the two methods configure_item and validate_item + ## + + sub test_imap_ui { + my $im = shift; + + # We are going to set up a template object that we will pass into + # configure_item and validate_item. + # Later, we'll test whether the correct parameters are set to the + # correct values. + + # Here's a list of all the templates we have to test: + # imap-bucket-folders.thtml + # imap-options.thtml + # imap-watch-folders.thtml + # imap-connection-details.thtml + # imap-update-mailbox-list.thtml + # imap-watch-more-folders.thtml + + # We also need to provide those methods with a language hash: + my $html = UI::HTML->new(); + $html->{configuration__} = $im->{configuration__}; + $html->load_language( 'English' ); + my $language = $html->{language__}; + + # Start with the connection details + # imap-connection-details.thtml + + my $tmpl = HTML::Template->new( filename => '../skins/default/imap-connection-details.thtml' ); + + # Test the template itself. Does it contain all the variables that it must contain + test_assert_equal( $tmpl->query( name => 'IMAP_hostname'), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_port' ), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_password' ), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_login' ), 'VAR' ); + + # Now let the IMAP module populate the template + $im->config_( hostname => 'some host' ); + $im->config_( port => 'some port' ); + $im->config_( password => 'some password' ); + $im->config_( login => 'some login' ); + + $im->configure_item( 'imap_0_connection_details', $tmpl, $language ); + + test_assert_equal( $tmpl->param( 'IMAP_hostname'), 'some host' ); + test_assert_equal( $tmpl->param( 'IMAP_port' ), 'some port' ); + test_assert_equal( $tmpl->param( 'IMAP_password' ), 'some password' ); + test_assert_equal( $tmpl->param( 'IMAP_login' ), 'some login' ); + + + # imap-watch-folders.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-folders.thtml' ); + + test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_loop_watched_folders' ), 'LOOP' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_counter'] ), 'VAR' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_WatchedFolder_Msg' ] ), 'VAR' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_mailboxes'] ), 'LOOP' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_mailboxes', 'IMAP_mailbox' ] ), 'VAR' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_mailboxes', 'IMAP_selected' ] ), 'VAR' ); + + # We set both, the mailboxes__ arrayref and the list of watched folders, to be empty + $im->{mailboxes__} = []; + $im->config_( 'watched_folders', '' ); + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + # Now we set only one to a non-empty list + $im->{mailboxes__} = [ 1 ]; + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + $im->{mailboxes__} = []; + $im->watched_folders__( 'INBOX' ); + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + # Finally, both get a value + $im->{mailboxes__} = [1]; + $im->watched_folders__( 'second' ); + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + my %params = map { $_ => 1 } $tmpl->param('IMAP_loop_watched_folders'); + #use Data::Dumper; warn Dumper( \%params ); + test_assert_equal( 1, 1 ); + + + + + # imap-watch-more-folders.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-more-folders.thtml' ); + + test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); + + $im->{mailboxes__} = []; + $im->configure_item( 'imap_2_watch_more_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + $im->{mailboxes__} = [1]; + $im->configure_item( 'imap_2_watch_more_folders', $tmpl, $language ); + test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + + + } + ################################################################################# *************** *** 389,393 **** rmtree( 'corpus' ); test_assert( rec_cp( 'corpus.base', 'corpus' ) ); ! test_assert( rmtree( 'corpus/CVS' ) > 0 ); unlink 'popfile.db'; --- 501,505 ---- rmtree( 'corpus' ); test_assert( rec_cp( 'corpus.base', 'corpus' ) ); ! test_assert( rmtree( 'corpus/CVS' ) > 0 ) if -e 'corpus/CVS'; unlink 'popfile.db'; |
From: Brian S. <xue...@us...> - 2007-11-13 22:58:42
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30226 Modified Files: Tag: b0_22_2 getparser.nsh Log Message: Update a comment to make it match the code. Index: getparser.nsh =================================================================== RCS file: /cvsroot/popfile/windows/Attic/getparser.nsh,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** getparser.nsh 18 Oct 2007 01:35:50 -0000 1.1.2.2 --- getparser.nsh 13 Nov 2007 22:58:45 -0000 1.1.2.3 *************** *** 6,10 **** # (and earlier) only supported the 'Kakasi' parser. The 1.0.0 # release offers a choice of three parsers (Kakasi, MeCab and ! # internal. To make it easier to change the Nihongo Parser # the 1.0.0 release creates a "Change" option in the "Add/Remove # Programs" entry for POPFile. This new option is handled by the --- 6,10 ---- # (and earlier) only supported the 'Kakasi' parser. The 1.0.0 # release offers a choice of three parsers (Kakasi, MeCab and ! # internal. To make it easier to change the Nihongo Parser # the 1.0.0 release creates a "Change" option in the "Add/Remove # Programs" entry for POPFile. This new option is handled by the *************** *** 43,47 **** ;------------------------------------------------ ! ; This script uses a special NSIS plugin (inetc) to download the SSL files. This plugin ; has much better proxy support than the standard NSISdl plugin shipped with NSIS. ; --- 43,47 ---- ;------------------------------------------------ ! ; This script uses a special NSIS plugin (inetc) to download the MeCab files. This plugin ; has much better proxy support than the standard NSISdl plugin shipped with NSIS. ; *************** *** 188,195 **** # In order to keep the size of the uninstaller down (and thus reduce the # overall size of the installer) we only install these extra Perl packages ! # when _installing_ POPFile. When the uninstaller is used to _change_ the ! # selected Nihongo parser an error message asking the user to re-run the ! # installer is shown if it looks like these extra Perl packages are missing ! # from the existing installation. #-------------------------------------------------------------------------- --- 188,198 ---- # In order to keep the size of the uninstaller down (and thus reduce the # overall size of the installer) we only install these extra Perl packages ! # when _installing_ POPFile. ! # ! # To Do: ! # When the uninstaller is used to _change_ the selected Nihongo parser ! # an error message asking the user to re-run the installer should be shown ! # if it looks like these extra Perl packages are missing from the existing ! # installation. #-------------------------------------------------------------------------- *************** *** 369,373 **** !define L_RESERVED $0 ; used in system.dll call ! !define L_RESULT $R0 ; result from 'GetSSLFile' function or the 'untgz' plugin ; WARNING: The 'untgz' plugin is hard-coded to use $R0 --- 372,376 ---- !define L_RESERVED $0 ; used in system.dll call ! !define L_RESULT $R0 ; result from 'GetMeCabFile' function or the 'untgz' plugin ; WARNING: The 'untgz' plugin is hard-coded to use $R0 |
From: Brian S. <xue...@us...> - 2007-11-13 22:58:15
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29475 Modified Files: Tag: b0_22_2 installer-Uninstall.nsh installer.nsi Log Message: The optional IMAP component is no longer a single file. Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.16 retrieving revision 1.242.4.17 diff -C2 -d -r1.242.4.16 -r1.242.4.17 *** installer.nsi 10 Nov 2007 13:43:08 -0000 1.242.4.16 --- installer.nsi 13 Nov 2007 22:58:10 -0000 1.242.4.17 *************** *** 201,205 **** ;-------------------------------------------------------------------------- ! ;; SetCompress off SetCompressor /solid lzma --- 201,205 ---- ;-------------------------------------------------------------------------- ! ## SetCompress off SetCompressor /solid lzma *************** *** 1552,1555 **** --- 1552,1558 ---- File "..\engine\Services\IMAP.pm" + SetOutpath "$G_ROOTDIR\Services\IMAP" + File "..\engine\Services\IMAP\Client.pm" + Delete "$G_ROOTDIR\POPFile\IMAP.pm" Delete "$G_ROOTDIR\Server\IMAP.pm" Index: installer-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-Uninstall.nsh,v retrieving revision 1.4.2.14 retrieving revision 1.4.2.15 diff -C2 -d -r1.4.2.14 -r1.4.2.15 *** installer-Uninstall.nsh 10 Nov 2007 13:43:08 -0000 1.4.2.14 --- installer-Uninstall.nsh 13 Nov 2007 22:58:10 -0000 1.4.2.15 *************** *** 846,849 **** --- 846,851 ---- RMDir "$G_ROOTDIR\Server" + Delete "$G_ROOTDIR\Services\IMAP\*.pm" + RMDir "$G_ROOTDIR\Services\IMAP" Delete "$G_ROOTDIR\Services\*.pm" RMDir "$G_ROOTDIR\Services" *************** *** 1152,1156 **** ; Uninstalluser.exe deletes all HKCU registry data except for the 'Add/Remove Programs' entry ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" --- 1154,1158 ---- ; Uninstalluser.exe deletes all HKCU registry data except for the 'Add/Remove Programs' entry ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" *************** *** 1197,1201 **** Push ${L_REGDATA} ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" --- 1199,1203 ---- Push ${L_REGDATA} ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" *************** *** 1207,1211 **** !undef L_REGDATA ! FunctionEnd --- 1209,1213 ---- !undef L_REGDATA ! FunctionEnd |
From: Brian S. <xue...@us...> - 2007-11-13 22:56:04
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29108 Modified Files: Tag: b0_22_2 installer-SecPOPFile-body.nsh Log Message: On Vista targets the ARP entry is now stored in HKCU instead of HKLM. Remove any matching HKLM entry to allow the UAC plugin to do its stuff. Index: installer-SecPOPFile-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-body.nsh,v retrieving revision 1.3.2.12 retrieving revision 1.3.2.13 diff -C2 -d -r1.3.2.12 -r1.3.2.13 *** installer-SecPOPFile-body.nsh 10 Nov 2007 13:43:08 -0000 1.3.2.12 --- installer-SecPOPFile-body.nsh 13 Nov 2007 22:56:00 -0000 1.3.2.13 *************** *** 435,439 **** SetShellVarContext current ! ; Create entry in the Control Panel's "Add/Remove Programs" list ClearErrors --- 435,442 ---- SetShellVarContext current ! ; Create an entry in the Control Panel's "Add/Remove Programs" list. The installer runs with ! ; admin rights so normally HKLM is used but on Vista HKCU is used in order to avoid problems ! ; with UAC (if HKLM is used then Vista elevates the uninstaller _before_ the UAC plugin gets ! ; a chance!) ClearErrors *************** *** 441,445 **** IfErrors use_HKLM StrCpy ${L_TEMP} ${L_RESULT} 1 ! StrCmp ${L_TEMP} '6' create_arp_entry use_HKLM: --- 444,456 ---- IfErrors use_HKLM StrCpy ${L_TEMP} ${L_RESULT} 1 ! IntCmp ${L_TEMP} 5 use_HKLM use_HKLM ! ReadRegStr ${L_RESULT} HKLM \ ! "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" ! StrCmp ${L_RESULT} "$G_ROOTDIR\uninstall.exe" delete_HKLM_entry ! StrCmp ${L_RESULT} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 create_arp_entry ! ! delete_HKLM_entry: ! DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" ! Goto create_arp_entry use_HKLM: |
From: Manni H. <man...@us...> - 2007-11-13 10:38:36
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9132/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Squashed a little bug: we didn't update our list of mailboxes when logging in through a single connection. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.6 retrieving revision 1.9.4.7 diff -C2 -d -r1.9.4.6 -r1.9.4.7 *** IMAP.pm 11 Nov 2007 16:42:54 -0000 1.9.4.6 --- IMAP.pm 13 Nov 2007 10:38:33 -0000 1.9.4.7 *************** *** 529,532 **** --- 529,537 ---- } + # Build a list of IMAP mailboxes if we haven't already got one: + unless ( @{$self->{mailboxes__}} ) { + @{$self->{mailboxes__}} = $imap->get_mailbox_list(); + } + # Do a STATUS to check UIDVALIDITY and UIDNEXT my $info = $imap->status( $folder ); *************** *** 1202,1206 **** if ( $name eq 'imap_1_watch_folders' ) { ! # We can only configure this when we have a list of mailboxes available on the server if ( @{$self->{mailboxes__}} < 1 || ( ! $self->watched_folders__() ) ) { $templ->param( IMAP_if_mailboxes => 0 ); --- 1207,1211 ---- if ( $name eq 'imap_1_watch_folders' ) { ! # We can only configure this if we have a list of mailboxes on the server available if ( @{$self->{mailboxes__}} < 1 || ( ! $self->watched_folders__() ) ) { $templ->param( IMAP_if_mailboxes => 0 ); |
From: Manni H. <man...@us...> - 2007-11-11 16:42:55
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6690/tests Modified Files: Tag: b0_22_2 IMAP_test_server.pl TestIMAP.tst Log Message: Major changes: * refactored the code and created a new module that contains all the IMAP-client code. This makes the IMAP stuff much simpler to maintain. * added a method that will use only one connection to keep all our folders under control. This new mode is now the default. * did much work on the IMAP tests. coverage for the client module: 86%, for the IMAP module itself: 58%. TODO: * port this to cvs HEAD * document installation of the new module. * add yet more tests. * test in the wild Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** TestIMAP.tst 6 Feb 2006 15:19:10 -0000 1.3.4.1 --- TestIMAP.tst 11 Nov 2007 16:42:54 -0000 1.3.4.2 *************** *** 23,27 **** # # --------------------------------------------------------------------------------------------- ! use POPFile::Configuration; --- 23,39 ---- # # --------------------------------------------------------------------------------------------- ! # TODO: ! # IMAP.pm: ! # * changed uidvalidity while connecting ! # * fail while statusing ! # * duplicate hash value => duplicate message in inbox ! # * fail while fetching a part ! # * fail while fetching_header_fields ! # * configure and validate item ! # ! # Client.pm ! # * ssl connection (difficult) ! # * fail while saying something ! # * say no to copy msg use POPFile::Configuration; *************** *** 32,49 **** use Classifier::Bayes; use Classifier::WordMangle; $SIG{CHLD} = 'IGNORE'; - rmtree( 'messages' ); - rmtree( 'corpus' ); - test_assert( rec_cp( 'corpus.base', 'corpus' ) ); - test_assert( rmtree( 'corpus/CVS' ) > 0 ); - - unlink 'popfile.db'; - unlink 'stopwords'; - test_assert( copy ( 'stopwords.base', 'stopwords' ) ); - - mkdir 'messages'; - # This test will fork itself. The child will run # the test server, the parent will run the tests. --- 44,51 ---- use Classifier::Bayes; use Classifier::WordMangle; + use File::Copy; $SIG{CHLD} = 'IGNORE'; # This test will fork itself. The child will run # the test server, the parent will run the tests. *************** *** 60,124 **** else { # First, start POPFile. - my $c = new POPFile::Configuration; - my $mq = new POPFile::MQ; - my $l = new POPFile::Logger; - my $b = new Classifier::Bayes; - my $w = new Classifier::WordMangle; - my $h = new POPFile::History; my $im = new Services::IMAP; ! $c->configuration( $c ); ! $c->mq( $mq ); ! $c->logger( $l ); ! $c->initialize(); - $l->configuration( $c ); - $l->mq( $mq ); - $l->logger( $l ); ! $l->initialize(); ! $w->configuration( $c ); ! $w->mq( $mq ); ! $w->logger( $l ); ! $w->start(); ! $mq->configuration( $c ); ! $mq->mq( $mq ); ! $mq->logger( $l ); ! $b->configuration( $c ); ! $b->mq( $mq ); ! $b->logger( $l ); ! $h->configuration( $c ); ! $h->mq( $mq ); ! $h->logger( $l ); ! $b->history( $h ); ! $h->classifier( $b ); ! $h->initialize(); ! $b->module_config_( 'html', 'language', 'English' ); ! $b->module_config_( 'html', 'port', '8080' ); ! ! $b->{parser__}->mangle( $w ); ! $b->initialize(); ! test_assert( $b->start() ); ! test_assert( $h->start() ); ! my $session = $b->get_session_key( 'admin', '' ); ! #$l->config_( 'level', 2 ); ! $l->service(); ! # Configure the IMAP module so it will ! # talk to the server. $im->configuration( $c ); $im->mq( $mq ); --- 62,355 ---- else { # First, start POPFile. + my ( $c, $mq, $l, $b, $w, $h ) = start_popfile(); my $im = new Services::IMAP; + my $session = $b->get_session_key( 'admin', '' ); ! # Configure the IMAP module so it will ! # talk to the server. ! configure_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_client( $im ); ! $mq->stop(); ! $h->stop(); ! $im->stop(); ! $b->stop(); ! rmtree( 'imap.spool' ); ! } ! ################################################################################# ! # Tests for Services::IMAP ! # Test classification, reclassification, UI stuff and error handling ! ## ! sub test_imap_module { ! my ( $im, $c, $mq, $l, $b, $h ) = @_; ! my $session = $b->get_session_key( 'admin', '' ); ! test_assert( $im->start() ); ! # Login. The server doesn't have any messages for us yet ! $im->log_( 0, "---- testing login to empty server (uidnext and uidvalidity)" ); ! $im->config_( 'login', 'someone' ); ! $im->service(); ! foreach my $folder (qw/ INBOX personal spam other / ) { ! my $client = $im->{folders__}{$folder}{imap}; ! test_assert( $client ); ! # Did we get the UIDVALIDITY values correctly? ! test_assert_equal( $client->uid_validity( $folder ), 1 ); ! # Did we note the correct UIDNEXT values? ! test_assert_equal( $client->uid_next( $folder ), 1 ); ! } ! # We change the uidvalidity and see whether the module detects ! # the difference between the (manipulated) stored value and ! # the value from the server. ! my $client = $im->{folders__}{'spam'}{imap}; ! $client->uid_validity( 'spam', 50 ); ! $im->{last_update__} = 0; ! $im->service(); ! test_assert_equal( $client->uid_validity( 'spam' ), 1 ); ! $im->disconnect_folders__(); ! # Let the INBOX have four new messages, make sure they are ! # classified correctly and moved to the according folders. ! $im->log_( 0, "---- testing classify with 6 new messages" ); ! $im->config_( 'login', 'new_INBOX_007_003_004_005_013_021' ); ! $b->create_magnet( $session, 'other', 'from', 'cxc...@ya...' ); ! $im->{last_update__} = 0; ! $im->service(); ! $mq->service(); ! $h->service(); ! # The message must have ended up as spam and must have been ! # moved to the spam folder, except for the magneted msg. ! test_assert( -e 'imap.spool/spam/1' ); ! test_assert( -e 'imap.spool/spam/2' ); ! test_assert( -e 'imap.spool/spam/3' ); ! test_assert( -e 'imap.spool/spam/4' ); ! test_assert( -e 'imap.spool/spam/5' ); ! test_assert( -e 'imap.spool/other/1' ); ! # move msgs 1, 2, and 3 to folder presonal ! $client = $im->{folders__}{'spam'}{imap}; ! test_assert( $client ); ! test_assert_equal( $client->select( 'spam' ), 1 ); ! test_assert_equal( $client->move_message( 1, 'personal' ), 1 ); ! test_assert_equal( $client->move_message( 2, 'personal' ), 1 ); ! test_assert_equal( $client->move_message( 3, 'personal' ), 1 ); ! ! # move msgs 4 and 5 to folder other ! test_assert_equal( $client->move_message( 4, 'other' ), 1 ); ! test_assert_equal( $client->move_message( 5, 'other' ), 1 ); ! ! # let the IMAP module have a look ! $im->log_( 0, "---- Testing reclassification" ); ! $im->{last_update__} = 0; ! $im->service(); ! $mq->service(); ! $h->service(); + # check classification stored in history + test_assert_equal( ($h->get_slot_fields( 1 ))[8], 'personal' ); + test_assert_equal( ($h->get_slot_fields( 2 ))[8], 'personal' ); + test_assert_equal( ($h->get_slot_fields( 3 ))[8], 'personal' ); + test_assert_equal( ($h->get_slot_fields( 4 ))[8], 'other' ); + test_assert_equal( ($h->get_slot_fields( 5 ))[8], 'other' ); + + # check that history knows that the msgs were reclassfified + test_assert_equal( ($h->get_slot_fields( 1 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 2 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 3 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 4 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 5 ))[9], 4 ); + + # history should also know about the used manget + test_assert_equal( ($h->get_slot_fields( 6 ))[11], 'cxc...@ya...' ); + + # get the msgs hashes and ask the imap module whether those messages + # can be reclassified. It should say 'no!' + foreach ( 1 .. 5 ) { + my $hash = ($h->get_slot_fields( $_ ))[6]; + test_assert_equal( $im->can_reclassify__( $hash, 'spam' ), undef ); + test_assert_equal( $im->can_classify__( $hash ), undef ); #QUATSCH + } + + # check that a fresh classification confirms the reclassification + test_assert_equal( $b->classify( $session, 'TestMailParse007.msg' ), 'personal' ); + + $im->disconnect_folders__(); + + # Check what happens when we time out + $im->log_( 0, "---- Testing time-out behaviour for the module." ); + $im->config_( 'login', 'timeOut1' ); + $im->{last_update__} = 0; + $im->service(); + $im->disconnect_folders__(); + + # Make the server drop the connection and make sure we don't crash + $im->log_( 0, "---- Testing dropped-connection behaviour for the module." ); + $im->config_( 'login', 'dropConnection3' ); + $im->{last_update__} = 0; + $im->service(); + + $im->log_( 0, "---- Testing train_on_archive." ); + $im->config_( login => 'new_INBOX_007_003_004_005_013_021' ); + $im->{last_update__} = 0; + $client = $im->new_imap_client(); + $client->select( 'INBOX' ); + $client->move_message( 7, 'personal' ); + $client->move_message( 8, 'other' ); + $client->move_message( 9, 'spam' ); + $client->move_message( 10, 'personal' ); + $client->move_message( 11, 'other' ); + $client->move_message( 12, 'spam' ); + + $im->config_( 'training_mode', 1 ); + $im->config_( login => 'someone' ); + $im->service(); + test_assert_equal( $im->config_( 'training_mode' ), 0 ); + + # Test the multiple-connection approach + $im->log_( 0, "---- Testing multiple connections" ); + $im->config_( use_multiple_connections => 1 ); + $im->config_( login => 'someone' ); + $im->{last_update__} = 0; + $im->service(); + $im->config_( use_multiple_connections => 0 ); + # TODO: login and place some msgs in the INBOX. + # check classifications. + } + + + ################################################################################# + # Tests for Services::IMAP::Client + # Test the code that actually talks to the IMAP + # server + ## + + sub test_imap_client { + my $im = shift; + + $im->log_( 0, "---- Testing various client methods" ); + $im->config_( 'login', 'someone' ); + my $client = $im->new_imap_client(); + + test_assert( $client, "Have we got a valid imap client?" ); + test_assert( $client->connected() ); + my @mailboxes = $client->get_mailbox_list(); + test_assert_equal( scalar @mailboxes, 5 ); + + test_assert_equal( 1, $client->noop() ); + my $info = $client->status( 'INBOX' ); + test_assert_equal( $info->{UIDNEXT}, 13 ); + test_assert_equal( $info->{UIDVALIDITY}, 1 ); + test_assert_equal( $client->select( 'INBOX' ), 1 ); + + test_assert_equal( $client->uid_next( 'INBOX' ), 7 ); + test_assert_equal( $client->uid_validity( 'INBOX' ), 1 ); + + $client->uid_next( 'INBOX', 100 ); + test_assert_equal( $client->uid_next( 'INBOX' ), 100 ); + + $client->uid_validity( 'INBOX', 99 ); + test_assert_equal( $client->uid_validity( 'INBOX' ), 99 ); + + $client->uid_validity( 'INBOX', 1 ); + test_assert_equal( $client->uid_validity( 'INBOX' ), 1 ); + + test_assert_equal( 1, $client->expunge() ); + + $client->say( 'unknown command' ); + test_assert_equal( $client->get_response(), -1 ); + + test_assert_equal( $client->select( 'personal' ), 1 ); + $client->uid_next( 'personal', 0 ); + my @msgs = $client->get_new_message_list(); + test_assert_equal( scalar @msgs, 5 ); + + $client->move_message( 1, 'spam' ); + $client->uid_next( 'spam', 0 ); + $client->select( 'spam' ); + @msgs = $client->get_new_message_list(); + test_assert_equal( scalar @msgs, 3 ); + + test_assert( $client->logout()); + + $im->log_( 0, "---- testing client methods with 3 new messages." ); + $im->config_( 'login', 'new_INBOX_003_002_001' ); + $client = $im->new_imap_client(); + $client->uid_next( 'INBOX', 0 ); + @msgs = $client->get_new_message_list_unselected( 'INBOX' ); + test_assert_equal( scalar @msgs, 3 ); + + # Now get the messages and compare them to the originals + foreach my $msg_number ( qw/ 003 002 001 / ) { + my $uid = shift @msgs; + my ( $ok, @msg_lines ) = $client->fetch_message_part( $uid, '' ); + test_assert_equal( $ok, 1 ); + my $filename = "TestMailParse$msg_number.msg"; + if ( open my $ORG, '<', $filename ) { + my @org_lines = (); + while ( <$ORG> ) { + push @org_lines, $_; + } + close $ORG; + foreach my $org_line ( @org_lines ) { + my $msg_line = shift @msg_lines; + $org_line =~ s/[\r\n]//g; + $msg_line =~ s/[\r\n]//g; + test_assert_equal( $msg_line, $org_line ); + } + $uid++; + } + else { + die "Could not open message $filename ($!)"; + } + } + + $im->log_( 0, "---- Testing failing login behaviour for client" ); + $im->config_( 'login', 'fail' ); + $im->new_imap_client(); + test_assert_equal( $im->{imap_error}, 'NO_LOGIN' ); + + $im->log_( 0, "---- testing time-out behaviour in client" ); + $im->config_( 'login', 'timeOut1' ); + $client = $im->new_imap_client(); + eval { + $client->get_mailbox_list(); + }; + test_assert( $@ ); + test_assert_regexp( $@, 'POPFILE-IMAP-EXCEPTION: ' ); + # sleep 3; + + $im->log_( 0, "---- testing something with the client here." ); + $im->config_( 'login', 'new_INBOX_003_002_001' ); + + $im->log_( 0, "shutting down the test server by logging in as user 'shutdown'." ); + # close the server process by logging in as user "shutdown" + $im->config_( 'login', 'shutdown' ); + eval { + $im->new_imap_client(); + }; + test_assert( $im->{imap_error} ); + test_assert_equal( $im->{imap_error}, 'NO_LOGIN' ); + } + + + ################################################################################# + # configure_imap_module + # Tweak our configuration settings to prepare the test environment + ## + + sub configure_imap_module { + my ( $im, $c, $mq, $l, $b, $h ) = @_; $im->configuration( $c ); $im->mq( $mq ); *************** *** 136,139 **** --- 367,373 ---- $im->config_( 'watched_folders', '' ); + $im->global_config_( 'message_cutoff', 100000 ); + $im->global_config_( 'timeout', 4 ); + $im->{last_update__} = 0; $im->watched_folders__( 'INBOX' ); *************** *** 142,227 **** $im->folder_for_bucket__( 'other', 'other' ); $im->folder_for_bucket__( 'unclassified', 'unclassified' ); - test_assert( $im->start() ); ! $im->config_( 'login', 'someone' ); ! $im->service(); ! # Did we get the UIDVALIDITY values correctly? ! test_assert_equal( $im->uid_validity__( 'INBOX' ), 1 ); ! test_assert_equal( $im->uid_validity__( 'personal' ), 1 ); ! test_assert_equal( $im->uid_validity__( 'spam' ), 1 ); ! test_assert_equal( $im->uid_validity__( 'other' ), 1 ); ! # Did we note the correct UIDNEXT values? ! test_assert_equal( $im->uid_next__( 'INBOX' ), 1 ); ! test_assert_equal( $im->uid_next__( 'personal' ), 1 ); ! test_assert_equal( $im->uid_next__( 'spam' ), 1 ); ! test_assert_equal( $im->uid_next__( 'other' ), 1 ); ! $im->disconnect_folders__(); ! # Let the INBOX have one new message, make sure it is classified correctly ! # and moved to the according folder. ! ! $im->config_( 'login', 'new_INBOX_003' ); ! $im->{last_update__} = 0; ! $im->service(); ! $mq->service(); ! $h->service(); ! ! # The message must have ended up as spam and must have been ! # moved to the spam folder ! ! test_assert( -e 'imap.spool/spam/1' ); ! ! # This is a good opportunity to test reclassify-on-move: ! # we move the message from the spam folder to the ! # personal folder. The IMAP module should see this and ! # reclassify the message to that bucket. We test whether ! # history returns the changed classification and if ! # bayes comes up with the same classification ! ! # move to folder presonal ! copy 'imap.spool/spam/1', 'imap.spool/personal/1'; ! unlink 'imap.spool/spam/1'; ! ! # let the IMAP module have a look ! $im->{last_update__} = 0; ! $im->service(); ! $mq->service(); ! $h->service(); ! ! # check classification stored in history ! test_assert_equal( ($h->get_slot_fields( 1 ))[8], 'personal' ); ! ! # check that a fresh classification confirms the reclassification ! test_assert_equal( $b->classify( $session, 'TestMailParse003.msg' ), 'personal' ); ! ! $im->disconnect_folders__(); ! ! # test magnet match ! ! ! # Make the server drop the connection and make sure we don't crash ! ! $im->config_( 'login', 'dropConnection3' ); ! $im->service(); ! # close the server process by logging in as user "shutdown" ! $im->config_( 'login', 'shutdown' ); ! $im->{last_update__} = 0; ! $im->service(); ! foreach ( $b->get_buckets( $session ) ) { print "$_\n"; } ! $mq->stop(); ! $h->stop(); ! $im->stop(); ! $b->stop(); ! ! rmtree( 'imap.spool' ); } - 1; --- 376,436 ---- $im->folder_for_bucket__( 'other', 'other' ); $im->folder_for_bucket__( 'unclassified', 'unclassified' ); + } ! ################################################################################# ! # start_popfile ! # Bring up the POPFile engine and prepare the test environment ! ## ! sub start_popfile { ! rmtree( 'messages' ); ! rmtree( 'corpus' ); ! test_assert( rec_cp( 'corpus.base', 'corpus' ) ); ! test_assert( rmtree( 'corpus/CVS' ) > 0 ); ! unlink 'popfile.db'; ! unlink 'stopwords'; ! test_assert( copy ( 'stopwords.base', 'stopwords' ) ); ! mkdir 'messages'; ! my $c = new POPFile::Configuration; ! my $mq = new POPFile::MQ; ! my $l = new POPFile::Logger; ! my $b = new Classifier::Bayes; ! my $w = new Classifier::WordMangle; ! my $h = new POPFile::History; ! foreach ( $c, $l, $w, $mq, $h, $b ) { ! $_->configuration( $c ); ! $_->mq( $mq ); ! $_->logger( $l ) unless $_ == $l; ! } ! $b->history( $h ); ! $h->classifier( $b ); ! $h->initialize(); ! ! $b->module_config_( 'html', 'language', 'English' ); ! $b->module_config_( 'html', 'port', '8080' ); ! ! $b->{parser__}->mangle( $w ); ! $b->initialize(); ! ! test_assert( $b->start() ); ! test_assert( $h->start() ); ! ! $l->initialize(); ! $l->config_( 'level', 1 ); ! ! $l->config_( logdir => '/tmp/' ); ! $l->global_config_( msgdir => 'msgs' ); ! $l->service(); ! ! return ( $c, $mq, $l, $b, $w, $h ); } + 1; Index: IMAP_test_server.pl =================================================================== RCS file: /cvsroot/popfile/engine/tests/IMAP_test_server.pl,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** IMAP_test_server.pl 6 Feb 2006 15:19:10 -0000 1.2.4.1 --- IMAP_test_server.pl 11 Nov 2007 16:42:54 -0000 1.2.4.2 *************** *** 41,44 **** --- 41,45 ---- use IO::Select; use File::Copy; + use Date::Format; use strict; use warnings; *************** *** 49,62 **** my $lf = "\012"; my $eol = "$cr$lf"; ! my $debug = 0; my $spool = "imap.spool"; my @mailboxes = qw/INBOX spam personal other unclassified/; ! # This is where we store all the folders' UIDNEXT values my %uidnext; ! foreach ( @mailboxes ) { ! $uidnext{ $_ } = 1; } --- 50,67 ---- my $lf = "\012"; my $eol = "$cr$lf"; ! my $debug = 1; my $spool = "imap.spool"; + # if nothing happens with in $idle_timeout seconds + # we call exit. + my $idle_timeout = 6; + my @mailboxes = qw/INBOX spam personal other unclassified/; ! # This is where we store all the folders' UIDNEXT values my %uidnext; ! foreach my $box ( @mailboxes ) { ! uid_next( $box, 1 ); } *************** *** 82,86 **** } chdir ".."; ! --- 87,91 ---- } chdir ".."; ! *************** *** 94,104 **** die "Socket could not be created. Reason: $!\n" unless ($main_sock); # The endless loop that accepts incoming connections. while ( 1 ) { my $new_sock = $main_sock->accept(); - # We set up a pipe that lets the child tell the parent that it # no longer needs to wait for new connections. --- 99,126 ---- die "Socket could not be created. Reason: $!\n" unless ($main_sock); + local $SIG{ALRM} + = sub { + $main_sock->shutdown(2); + debug( "Exiting due to idle time-out." ); + die "IMAP-Test-Server timed out. Did your tests just crash?"; + }; + # The endless loop that accepts incoming connections. + # It's not really endless. There are two ways to exit + # that loop: + # 1. The regular way: A client tries to login with the user + # name 'shutdown'. In that case, we shut down the socket + # and exit. + # 2. If the tests didn't run the way they should and the + # testing parent dies or does something otherwise silly, + # we keep an eye on the clock and exit if nothing happened + # in the last $idle_timeout seconds. while ( 1 ) { + alarm $idle_timeout if $debug; + debug ( "Waiting for a new client to connect." ); my $new_sock = $main_sock->accept(); # We set up a pipe that lets the child tell the parent that it # no longer needs to wait for new connections. *************** *** 106,109 **** --- 128,132 ---- pipe my $reader, my $writer; + debug( "Trying to fork..." ); my $pid = fork(); die "Cannot fork: $!" unless defined( $pid ); *************** *** 112,115 **** --- 135,139 ---- if ( $pid == 0 ) { close $reader; + close $main_sock; $writer->autoflush( 1 ); *************** *** 121,125 **** while ( my $buf = <$new_sock> ) { ! debug( "Received a command: $buf" ); # Look out for the shutdown signal and tell the parent # that it's time to go home when we get it. Tell the --- 145,149 ---- while ( my $buf = <$new_sock> ) { ! debug( "client said: $buf" ); # Look out for the shutdown signal and tell the parent # that it's time to go home when we get it. Tell the *************** *** 138,142 **** if ( $time_out_at == $command_no ) { ! sleep 300; } --- 162,175 ---- if ( $time_out_at == $command_no ) { ! alarm 0 if $debug; ! debug( "Going to sleep for $idle_timeout seconds" ); ! sleep $idle_timeout; ! #alarm $idle_timeout if $debug; ! # The client is supposed to drop its connection ! # at that point. So we are going to do the same thing ! # here: ! debug( "Child is exiting after time out" ); ! $new_sock->shutdown( 2 ); ! exit 0; } *************** *** 144,157 **** if ( $command_no == $drop_connection_at ) { $new_sock->shutdown( 2 ); } - # else we handle the command else { handle_command( $new_sock, $buf ); } - $command_no++; } ! exit 0; } --- 177,189 ---- if ( $command_no == $drop_connection_at ) { $new_sock->shutdown( 2 ); + alarm 0 if $debug; } # else we handle the command else { handle_command( $new_sock, $buf ); } $command_no++; } ! debug( "Child is exiting: EOF from socket" ); exit 0; } *************** *** 163,166 **** --- 195,199 ---- my $line = <$reader>; + debug ( "child said $line" ); if ( $line =~ /shutdown/ ) { close $reader; *************** *** 171,175 **** close $main_sock; ! # handle_command --- 204,208 ---- close $main_sock; ! print "\nThe IMAP_test_server is exiting.\n"; # handle_command *************** *** 186,190 **** # LOGIN - # This section is of special importance because the user name given # at login determines which stones we throw at IMAP.pm --- 219,222 ---- *************** *** 204,211 **** # New messages in one of the incoming mailboxes if ( $user =~ /^new_/ ) { ! $user =~ /_(\w+)_/; my $mailbox = $1; while ( $user =~ /_(\d+)/g ) { ! file_message ( $mailbox, $1 ); } } --- 236,243 ---- # New messages in one of the incoming mailboxes if ( $user =~ /^new_/ ) { ! $user =~ /_([a-zA-Z]+)_/; my $mailbox = $1; while ( $user =~ /_(\d+)/g ) { ! file_message( $mailbox, $1 ); } } *************** *** 232,236 **** # LIST - if ( $command =~ /^LIST "" "\*"/ && $state ne 'Not Authenticated' ) { foreach ( @mailboxes ) { --- 264,267 ---- *************** *** 249,253 **** # LOGOUT - if ( $command =~ /^LOGOUT/ ) { print $client "* BYE bye$eol"; --- 280,283 ---- *************** *** 259,268 **** } - # SELECT - if ( $command =~ /^SELECT "(.+)"$/ && ( $state eq 'Authenticated' || $state eq 'Selected' ) ) { my $mailbox = $1; if ( exists $uidnext{ $mailbox } ) { $state = 'Selected'; --- 289,297 ---- } # SELECT if ( $command =~ /^SELECT "(.+)"$/ && ( $state eq 'Authenticated' || $state eq 'Selected' ) ) { my $mailbox = $1; + uid_next ( $mailbox ); if ( exists $uidnext{ $mailbox } ) { $state = 'Selected'; *************** *** 280,292 **** # NOOP ! # (we check for Selected state here because we do not want the ! # IMAP module to do a NOOP unless we are Selected ! ! if ( $command =~ /^NOOP/ && $state eq 'Selected' ) { print $client "$tag OK NOOP complete.$eol"; return; } - # EXPUNGE if ( $command =~ /^EXPUNGE/ && $state eq 'Selected' ) { --- 309,317 ---- # NOOP ! if ( $command =~ /^NOOP/ ) { print $client "$tag OK NOOP complete.$eol"; return; } # EXPUNGE if ( $command =~ /^EXPUNGE/ && $state eq 'Selected' ) { *************** *** 297,308 **** # STATUS (we only need to handle STATUS commands asking for the UIDNEXT value because # IMAP.pm won't use any other STATUS commands) ! ! if ( $command =~ /^STATUS "(.+?)" \(UIDNEXT\)$/ && $state eq "Selected" ) { my $mailbox = $1; if ( exists $uidnext{ $mailbox } ) { my $number_of_messages = $uidnext{ $mailbox }; ! print $client "* STATUS $mailbox (UIDNEXT ", $uidnext{ $mailbox } , ")$eol"; print $client "$tag OK STATUS complete.$eol"; } --- 322,333 ---- # STATUS (we only need to handle STATUS commands asking for the UIDNEXT value because # IMAP.pm won't use any other STATUS commands) ! if ( $command =~ /^STATUS "(.+?)" \(UIDNEXT UIDVALIDITY\)$/ ) { my $mailbox = $1; + uid_next( $mailbox ); if ( exists $uidnext{ $mailbox } ) { my $number_of_messages = $uidnext{ $mailbox }; ! print $client "* STATUS $mailbox (UIDNEXT $uidnext{ $mailbox } UIDVALIDITY $uidvalidity)$eol"; print $client "$tag OK STATUS complete.$eol"; } *************** *** 319,323 **** my $uid = $1; my $part = $2; ! my $response; --- 344,348 ---- my $uid = $1; my $part = $2; ! my $response; *************** *** 369,373 **** print $client "$tag NO no such message$eol"; } ! return; } --- 394,398 ---- print $client "$tag NO no such message$eol"; } ! return; } *************** *** 386,391 **** } - - # If we get here, we don't know the command and say so --- 411,414 ---- *************** *** 403,413 **** ! sub select_mailbox ! { my ( $client, $mailbox ) = @_; local $\ = "$eol"; ! my @msgs = glob "$spool/$mailbox/*"; print $client "* ", scalar @msgs, " EXISTS"; --- 426,436 ---- ! sub select_mailbox { my ( $client, $mailbox ) = @_; local $\ = "$eol"; ! my @msgs = glob "$spool/$mailbox/*"; + uid_next( $mailbox ); print $client "* ", scalar @msgs, " EXISTS"; *************** *** 420,454 **** ! sub debug ! { return unless $debug; my @messages = @_; ! open LOG, ">>IMAPdebug.log"; foreach ( @messages ) { s/[\r\n]//g; ! print LOG "$_\n"; } ! close LOG; } ! ! sub file_message ! { my ( $folder, $msg ) = @_; ! my $new_uid = $uidnext{ $folder }; ! $uidnext{ $folder }++; ! copy "TestMailParse$msg.msg", "$spool/$folder/$new_uid"; } ! sub copy_message ! { my ( $uid, $from, $to ) = @_; ! if ( -e "$spool/$from/$uid" ) { if ( exists $uidnext{ $to } ) { my $new_uid = $uidnext{ $to }; ! $uidnext{ $to }++; copy "$spool/$from/$uid", "$spool/$to/$new_uid"; return 'OK Completed'; --- 443,477 ---- ! sub debug { return unless $debug; my @messages = @_; ! open my $LOG, '>>', 'IMAPdebug.log'; foreach ( @messages ) { s/[\r\n]//g; ! my $time = time2str( "%H:%M:%S", time ); ! print $LOG "$time: $_\n"; } ! close $LOG; } ! ! sub file_message { my ( $folder, $msg ) = @_; ! ! uid_next( $folder ); my $new_uid = $uidnext{ $folder }; ! uid_next( $folder, $uidnext{ $folder }+1 ); ! debug( "Trying to copy TestMailParse$msg.msg to $spool/$folder/$new_uid" ); copy "TestMailParse$msg.msg", "$spool/$folder/$new_uid"; } ! sub copy_message { my ( $uid, $from, $to ) = @_; ! if ( -e "$spool/$from/$uid" ) { + uid_next( $to ); if ( exists $uidnext{ $to } ) { my $new_uid = $uidnext{ $to }; ! uid_next( $to, $uidnext{ $to }+1 ); copy "$spool/$from/$uid", "$spool/$to/$new_uid"; return 'OK Completed'; *************** *** 456,469 **** return 'NO [TRYCREATE] Mailbox does not exist'; } ! } else { ! return 'NO Message does not exist'; } } ! ! ! sub delete_message ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { unlink "$spool/$folder/$uid"; --- 479,492 ---- return 'NO [TRYCREATE] Mailbox does not exist'; } ! } ! else { ! return "NO Message '$spool/$from/$uid' does not exist"; } } ! ! ! sub delete_message { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { unlink "$spool/$folder/$uid"; *************** *** 476,486 **** ! ! sub search_messages_ge ! { my ( $folder, $uid ) = @_; ! chdir "$spool/$folder/"; ! my @list; foreach ( glob "*" ) { --- 499,507 ---- ! sub search_messages_ge { my ( $folder, $uid ) = @_; ! chdir "$spool/$folder/"; ! my @list; foreach ( glob "*" ) { *************** *** 491,504 **** $flat .= " $_"; } ! chdir "../.."; ! return $flat; } ! sub get_header_fields ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; --- 512,524 ---- $flat .= " $_"; } ! chdir "../.."; ! return $flat; } ! sub get_header_fields { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; *************** *** 520,535 **** close MSG; my @headers = qw/message-id date subject received/; ! my $response = ''; ! foreach ( @headers ) { if ( exists $header{ $_ } ) { $response .= "\u$_: ${$header{ $_ }}[0]$eol"; ! } } ! return $response; } else { return; } --- 540,560 ---- close MSG; my @headers = qw/message-id date subject received/; ! my $response = ''; ! foreach ( @headers ) { if ( exists $header{ $_ } ) { $response .= "\u$_: ${$header{ $_ }}[0]$eol"; ! } } ! ! unless ( $response ) { ! warn "Server couldn't find any header fields in message '$spool/$folder/$uid'\n"; ! } ! return $response; } else { + warn "Server could not find file '$spool/$folder/$uid'\n"; return; } *************** *** 537,545 **** ! ! sub get_message ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; --- 562,568 ---- ! sub get_message { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; *************** *** 559,566 **** ! sub get_message_header ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; --- 582,588 ---- ! sub get_message_header { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; *************** *** 572,576 **** } close MSG; ! return "$response$eol"; } --- 594,598 ---- } close MSG; ! return "$response$eol"; } *************** *** 580,587 **** } ! sub get_message_text ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; --- 602,608 ---- } ! sub get_message_text { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; *************** *** 601,602 **** --- 622,655 ---- } + + sub uid_next { + my $folder = shift; + my $uidnext = shift; + + if ( open my $UIDS, '<', 'imap.uids' ) { + while ( <$UIDS> ) { + /(.+):(.+)[\r\n]/; + $uidnext{ $1 } = $2; + } + } + # else { + # die "IMAP-test-server has a problem: cannot open file 'imap.uids'"; + # } + + if ( defined $uidnext ) { + $uidnext{ $folder } = $uidnext; + if ( open my $UIDS, '>', 'imap.uids' ) { + foreach ( keys %uidnext ) { + print $UIDS "$_:$uidnext{ $_ }\n"; + } + } + else { + die "IMAP-test-server has a problem: cannot open file 'imap.uids'"; + } + } + + return $uidnext{ $folder }; + } + + + |
From: Manni H. <man...@us...> - 2007-11-11 16:42:53
|
Update of /cvsroot/popfile/engine/Services/IMAP In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6690/Services/IMAP Added Files: Tag: b0_22_2 Client.pm Log Message: Major changes: * refactored the code and created a new module that contains all the IMAP-client code. This makes the IMAP stuff much simpler to maintain. * added a method that will use only one connection to keep all our folders under control. This new mode is now the default. * did much work on the IMAP tests. coverage for the client module: 86%, for the IMAP module itself: 58%. TODO: * port this to cvs HEAD * document installation of the new module. * add yet more tests. * test in the wild --- NEW FILE: Client.pm --- # ---------------------------------------------------------------------------- # # Services::IMAP::Client--- Helper module for the POPFile IMAP module # # Copyright (c) 2001-2007 John Graham-Cumming # # $Revision: 1.1.2.1 $ # # This file is part of POPFile # # POPFile is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # POPFile is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with POPFile; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Originally created by Manni Heumann (man...@us...) # Modified by Sam Schinke (ssc...@us...) # Patches by David Lang (dav...@us...) # # ---------------------------------------------------------------------------- package Services::IMAP::Client; use base qw/ POPFile::Module /; use strict; use warnings; use IO::Socket; use Carp; my $eol = "\015\012"; my $cfg_separator = "-->"; # ---------------------------------------------------------------------------- # # new - Create a new IMAP client object # # IN: two subroutine refs and an integer # config -> reference to the config_ sub # log -> reference to logger module # global_config -> reference to the global_config_ sub # # OUT: a blessed object or undef if the config hash was incomplete # ---------------------------------------------------------------------------- sub new { my $class = shift; my $config = shift; my $log = shift; my $global_config = shift; my $self = bless {}, $class; $self->{logger__} = $log or return; $self->{config__} = $config or return; $self->{global_config__} = $global_config or return; $self->{host} = $self->config_( 'hostname' ); $self->{port} = $self->config_( 'port' ); $self->{login} = $self->config_( 'login' ); $self->{pass} = $self->config_( 'password' ); $self->{ssl} = $self->config_( 'use_ssl' ); $self->{timeout} = $self->global_config_( 'timeout' ); $self->{cutoff} = $self->global_config_( 'message_cutoff' ); $self->{socket} = undef; $self->{folder} = undef; $self->{tag} = 0; $self->{name__} = 'IMAP-Client'; return $self; } # ---------------------------------------------------------------------------- # # config_ - Replacement for POPFile::Module::config_ # ---------------------------------------------------------------------------- sub config_ { my $self = shift; return &{$self->{config__}}( @_ ); } # ---------------------------------------------------------------------------- # # global_config_ - Replacement for POPFile::Module::global_config_ # ---------------------------------------------------------------------------- sub global_config_ { my $self = shift; return &{$self->{global_config__}}( @_ ); } # ---------------------------------------------------------------------------- # # connect - Connect to the IMAP server. # # IN: - # OUT: true on success # undef on error # ---------------------------------------------------------------------------- sub connect { my $self = shift; my $hostname = $self->{host}; my $port = $self->{port}; my $use_ssl = $self->{ssl}; my $timeout = $self->{timeout}; $self->log_( 1, "Connecting to $hostname:$port" ); if ( $hostname ne '' && $port ne '' ) { my $response = ''; my $imap; if ( $use_ssl ) { require IO::Socket::SSL; $imap = IO::Socket::SSL->new ( Proto => "tcp", PeerAddr => $hostname, PeerPort => $port, Timeout => $timeout, ); } else { $imap = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $hostname, PeerPort => $port, Timeout => $timeout, ); } # Check that the connect succeeded for the remote server if ( $imap ) { if ( $imap->connected ) { # Set binmode on the socket so that no translation of CRLF # occurs binmode( $imap ) if $use_ssl == 0; # Wait for a response from the remote server and if # there isn't one then give up trying to connect my $selector = IO::Select->new( $imap ); unless ( () = $selector->can_read( $timeout ) ) { $self->log_( 0, "Connection timed out for $hostname:$port" ); return; } $self->log_( 0, "Connected to $hostname:$port timeout $timeout" ); # Read the response from the real server my $buf = $self->slurp_( $imap ); $self->log_( 1, ">> $buf" ); $self->{socket} = $imap; return 1; } } } else { $self->log_( 0, "Invalid port or hostname. Will not connect to server." ); return; } } # ---------------------------------------------------------------------------- # # login - Login on the IMAP server. # # IN: - # OUT: true on success # undef on error # ---------------------------------------------------------------------------- sub login { my $self = shift; my $login = $self->{login}; my $pass = $self->{pass}; $self->log_( 1, "Logging in" ); $self->say( 'LOGIN "' . $login . '" "' . $pass . '"' ); if ( $self->get_response() == 1 ) { return 1; } else { return; } } # ---------------------------------------------------------------------------- # # noop - Do a NOOP on the server. Whatever that might be good for. # # IN: - # OUT: see get_response() # ---------------------------------------------------------------------------- sub noop { my $self = shift; $self->say( 'NOOP' ); my $result = $self->get_response(); $self->log_( 0, "NOOP failed (return value $result)" ) unless $result == 1; return $result; } # ---------------------------------------------------------------------------- # # status - Do a STATUS on the server, asking for UIDNEXT and UIDVALIDITY # information. # # IN: $folder - name of the mailbox to be STATUSed # OUT: hasref with the keys UIDNEXT and UIDVALIDITY # ---------------------------------------------------------------------------- sub status { my $self = shift; my $folder = shift; my $ret = { UIDNEXT => undef, UIDVALIDITY => undef }; $self->say( "STATUS \"$folder\" (UIDNEXT UIDVALIDITY)" ); if ( $self->get_response() == 1 ) { my @lines = split /$eol/, $self->{last_response}; foreach ( @lines ) { if ( /^\* STATUS/ ) { if ( /UIDNEXT (\d+)/ ) { $ret->{UIDNEXT} = $1; } if ( /UIDVALIDITY (\d+)/ ) { $ret->{UIDVALIDITY} = $1; } } last; } } else { # TODO: what now? } foreach ( keys %$ret ) { if ( ! defined $ret->{$_}) { $self->log_( 0, "Could not get $_ STATUS for folder $folder." ); } } return $ret; } # ---------------------------------------------------------------------------- # # DESTROY - Destructor called by Perl # # Will close the socket if it's connected. # TODO: This method could be friendly and try to logout first. OTOH, we # might no longer be logged in. # # ---------------------------------------------------------------------------- sub DESTROY { my $self = shift; $self->log_( 1, "IMAP-Client is exiting" ); $self->{socket}->shutdown( 2 ) if defined $self->{socket}; } # ---------------------------------------------------------------------------- # # expunge - Issue an EXPUNGE command. We need to be in a SELECTED state for # this to work. # # IN: - # OUT: see get_response() # ---------------------------------------------------------------------------- sub expunge { my $self = shift; $self->say( 'EXPUNGE' ); $self->get_response(); } # ---------------------------------------------------------------------------- # # say - Say something to the server. This method will also provide a valid # tag and a nice line ending. # # IN: $command - String containing the command # OUT: true und success, undef on error # ---------------------------------------------------------------------------- sub say { my $self = shift; my $command = shift; $self->{last_command} = $command; my $tag = $self->{tag}; my $cmdstr = sprintf "A%05d %s%s", $tag, $command, $eol; # Talk to the server unless( print {$self->{socket}} $cmdstr ) { $self->bail_out( "Lost connection while I tried to say '$cmdstr'." ); } # Log command # Obfuscate login and password for logins: $cmdstr =~ s/^(A\d+) LOGIN ".+?" ".+"(.+)/$1 LOGIN "xxxxx" "xxxxx"$2/; $self->log_( 1, "<< $cmdstr" ); return 1; } # ---------------------------------------------------------------------------- # # get_response # # Get a response from our server. You should normally not need to call this function # directly. Use get_response__ instead. # # Arguments: # # $imap: A valid socket object # $last_command: The command we are issued before. # $tag_ref: A reference to a scalar that will receive tag value that can be # used to tag the next command # $response_ref: A reference to a scalar that will receive the servers response. # # Return value: # undef lost connection # 1 Server answered OK # 0 Server answered NO # -1 Server answered BAD # -2 Server gave unexpected tagged answer # -3 Server didn't say anything, but the connection is still valid (I guess this cannot happen) # # ---------------------------------------------------------------------------- sub get_response { my $self = shift; my $imap = $self->{socket}; local $SIG{ALRM} = sub { alarm 0; $self->bail_out( "The connection to the IMAP server timed out while we waited for a response." ); }; alarm $self->global_config_( 'timeout' ); # What is the actual tag we have to look for? my $actual_tag = sprintf "A%05d", $self->{tag}; my $response = ''; my $count_octets = 0; my $octet_count = 0; # Slurp until we find a reason to quit while ( my $buf = $self->slurp_( $imap ) ) { # Check for lost connections: if ( $response eq '' && ! defined $buf ) { $self->baild_out( "The connection to the IMAP server was lost while trying to get a response to command '$self->{last_command}'." ); } # If this is the first line of the response and # if we find an octet count in curlies before the # newline, then we will rely on the octet count if ( $response eq '' && $buf =~ m/{(\d+)}$eol/ ) { # Add the length of the first line to the # octet count provided by the server $count_octets = $1 + length( $buf ); } $response .= $buf; if ( $count_octets ) { $octet_count += length $buf; # There doesn't seem to be a requirement for the message to end with # a newline. So we cannot go for equality if ( $octet_count >= $count_octets ) { $count_octets = 0; } $self->log_( 2, ">> $buf" ); } # If we aren't counting octets (anymore), we look out for tag # followed by BAD, NO, or OK and we also keep an eye open # for untagged responses that the server might send us unsolicited if ( $count_octets == 0 ) { if ( $buf =~ /^$actual_tag (OK|BAD|NO)/ ) { if ( $1 ne 'OK' ) { $self->log_( 0, ">> $buf" ); } else { $self->log_( 1, ">> $buf" ); } last; } # Here we look for untagged responses and decide whether they are # solicited or not based on the last command we gave the server. if ( $buf =~ /^\* (.+)/ ) { my $untagged_response = $1; $self->log_( 1, ">> $buf" ); # This should never happen, but under very rare circumstances, # we might get a change of the UIDVALIDITY value while we # are connected if ( $untagged_response =~ /UIDVALIDITY/ && ( $self->{last_command} !~ /^SELECT/ && $self->{last_command} !~ /^STATUS/ ) ) { $self->log_( 0, "Got unsolicited UIDVALIDITY response from server while reading response for $self->{last_command}." ); } # This could happen, but will be caught by the eval in service(). # Nevertheless, we look out for unsolicited bye-byes here. if ( $untagged_response =~ /^BYE/ && $self->{last_command} !~ /^LOGOUT/ ) { $self->log_( 0, "Got unsolicited BYE response from server while reading response for $self->{last_command}." ); } } } } # save result away so we can always have a look later on $self->{last_response} = $response; alarm 0; # Increment tag for the next command/reply sequence: $self->{tag}++; if ( $response ) { # determine our return value # We got 'OK' and the correct tag. if ( $response =~ /^$actual_tag OK/m ) { return 1; } # 'NO' plus correct tag elsif ( $response =~ /^$actual_tag NO/m ) { return 0; } # 'BAD' and correct tag. elsif ( $response =~ /^$actual_tag BAD/m ) { return -1; } # Someting else, probably a different tag, but who knows? else { $self->log_( 0, "!!! Server said something unexpected !!!" ); return -2; } } else { $self->bail_out( "The connection to the IMAP server was lost while trying to get a response to command '$self->{last_command}'" ); } } # ---------------------------------------------------------------------------- # # select # # Do a SELECT on the passed-in folder. Returns the result of get_response() # # Arguments: # $folder: The name of a mailbox on the server # # Return value: # # INT 1 is ok, everything else is an error # ---------------------------------------------------------------------------- sub select { my $self = shift; my $folder = shift; $self->say( "SELECT \"$folder\"" ); my $result = $self->get_response(); if ( $result == 1 ) { $self->{folder} = $folder; } return $result } # ---------------------------------------------------------------------------- # # get_mailbox_list # # Request a list of mailboxes from the server behind the passed in socket object. # The list is sorted and returned # # Arguments: none # # Return value: list of mailboxes, possibly emtpy (or error) # ---------------------------------------------------------------------------- sub get_mailbox_list { my $self = shift; $self->log_( 1, "Getting mailbox list" ); $self->say( 'LIST "" "*"' ); my $result = $self->get_response(); if ( $result != 1 ) { $self->log_( 0, "LIST command failed (return value [$result])." ); return; } my @lines = split /$eol/, $self->{last_response}; my @mailboxes; foreach ( @lines ) { next unless /^\*/; s/^\* LIST \(.*\) .+? (.+)$/$1/; s/"(.*?)"/$1/; push @mailboxes, $1; } return sort @mailboxes; } # ---------------------------------------------------------------------------- # # logout # # log out of the the server we are currently connected to. # # Arguments: none # # Return values: # 0 on failure # 1 on success # ---------------------------------------------------------------------------- sub logout { my $self = shift; $self->log_( 1, "Logging out" ); $self->say( 'LOGOUT' ); if ( $self->get_response() == 1 ) { $self->{socket}->shutdown( 2 ); $self->{folder} = undef; $self->{socket} = undef; return 1; } else { return 0; } } # ---------------------------------------------------------------------------- # # move_message # # Will try to move a message on the IMAP server. # # arguments: # # $msg: # The UID of the message # $destination: # The destination folder. # # ---------------------------------------------------------------------------- sub move_message { my $self = shift; my $msg = shift; my $destination = shift; $self->log_( 1, "Moving message $msg to $destination" ); # Copy message to destination $self->say( "UID COPY $msg \"$destination\"" ); my $ok = $self->get_response(); # If that went well, flag it as deleted if ( $ok == 1 ) { $self->say( "UID STORE $msg +FLAGS (\\Deleted)" ); $ok = $self->get_response(); } else { $self->log_( 0, "Could not copy message ($ok)!" ); } return ( $ok ? 1 : 0 ); } # ---------------------------------------------------------------------------- # # get_new_message_list # # Will search for messages on the IMAP server that are not flagged as deleted # that have a UID greater than or equal to the value stored as UIDNEXTfor # the currently SELECTed folder. # # arguments: none # # return value: # # A sorted list (possibly empty) of the UIDs of matching messages. # # ---------------------------------------------------------------------------- sub get_new_message_list { my $self = shift; my $folder = $self->{folder}; my $uid = $self->uid_next( $folder ); $self->log_( 1, "Getting uids ge $uid in folder $folder" ); $self->say( "UID SEARCH UID $uid:* UNDELETED" ); my $result = $self->get_response(); if ( $result != 1 ) { $self->log_( 0, "SEARCH command failed (return value: $result)!" ); } # The server will respond with an untagged search reply. # This can either be empty ("* SEARCH") or if a # message was found it contains the numbers of the matching # messages, e.g. "* SEARCH 2 5 9". # In the latter case, the regexp below will match and # capture the list of messages in $1 my @matching = (); if ( $self->{last_response} =~ /\* SEARCH (.+)$eol/ ) { @matching = split / /, $1; } my @return_list = (); # Make sure that the UIDs reported by the server are really greater # than or equal to our passed in comparison value foreach my $num ( @matching ) { if ( $num >= $uid ) { push @return_list, $num; } } return ( sort { $a <=> $b } @return_list ); } # ---------------------------------------------------------------------------- # # get_new_message_list_unselected # # If we are not in the selected state, you can use this routine to get a list # of new messages on the server in a specific mailbox. # The routine will do a STATUS (UIDNEXT) and compare our old # UIDNEXT value to the new one. # If it turns out that the new value is larger than the old, the mailbox # is selected and the list of new UIDs gets retrieved. In that case, # we will remain in a selected state. # # arguments: $folder - the folder that should be examined # returns: see get_new_message_list # ---------------------------------------------------------------------------- sub get_new_message_list_unselected { my $self = shift; my $folder = shift; my $last_known = $self->uid_next( $folder ); my $info = $self->status( $folder ); if ( ! defined $info ) { $self->bail_out( "Could not get a valid response to the STATUS command." ); } else { my $new_next = $info->{UIDNEXT}; my $new_vali = $info->{UIDVALIDITY}; if ( $new_vali != $self->uid_validity( $folder ) ) { $self->log_( 0, "The folder $folder has a new UIDVALIDTIY value! Skipping new messages (if any)." ); $self->uid_validity( $folder, $new_vali ); return; } if ( $last_known < $new_next ) { $self->select( $folder ); return $self->get_new_message_list(); } } return; } # ---------------------------------------------------------------------------- # # fetch_message_part # # This function will fetch a specified part of a specified message from # the IMAP server and return the message as a list of lines. # It assumes that a folder is already SELECTed # # arguments: # # $msg: UID of the message # $part: The part of the message you want to fetch. Could be 'HEADER' for the # message headers, 'TEXT' for the body (including any attachments), or '' to # fetch the complete message. Other values are also possible, but currently # not used. 'BODYSTRUCTURE' could be interesting. # # return values: # # a boolean value indicating success/fallure and # a list containing the lines of the retrieved message (part). # # ---------------------------------------------------------------------------- sub fetch_message_part { my $self = shift; my $msg = shift; my $part = shift; my $folder = $self->{folder}; if ( $part ne '' ) { $self->log_( 1, "Fetching $part of message $msg" ); } else { $self->log_( 1, "Fetching message $msg" ); } if ( $part eq 'TEXT' || $part eq '' ) { my $limit = $self->{cutoff} || 0; $self->say( "UID FETCH $msg (FLAGS BODY.PEEK[$part]<0.$limit>)" ); } else { $self->say( "UID FETCH $msg (FLAGS BODY.PEEK[$part])" ); } my $result = $self->get_response(); if ( $part ne '' ) { $self->log_( 1, "Got $part of message # $msg, result: $result." ); } else { $self->log_( 1, "Got message # $msg, result: $result." ); } if ( $result == 1 ) { my @lines = (); # The first line now MUST start with "* x FETCH" where x is a message # sequence number anything else indicates that something went wrong # or that something changed. E.g. the message we wanted # to fetch is no longer there. my $last_response = $self->{last_response}; if ( $last_response =~ m/\^* \d+ FETCH/ ) { # The first line should contain the number of octets the server send us if ( $last_response =~ m/(?!$eol){(\d+)}$eol/ ) { my $num_octets = $1; # Grab the number of octets reported: my $pos = index $last_response, "{$num_octets}$eol"; $pos += length "{$num_octets}$eol"; my $message = substr $last_response, $pos, $num_octets; # Take the large chunk and chop it into single lines # We cannot use split here, because this would get rid of # trailing and leading newlines and thus omit complete lines. while ( $message =~ m/(.*?$eol)/g ) { push @lines, $1; } } # No number of octets: fall back, but issue a warning else { while ( $last_response =~ m/(.*?$eol)/g ) { push @lines, $1; } # discard the first and the two last lines; these are server status responses. shift @lines; pop @lines; pop @lines; $self->log_( 0, "Could not find octet count in server's response!" ); } } else { $self->log_( 0, "Unexpected server response to the FETCH command!" ); } return 1, @lines; } else { return 0; } } #--------------------------------------------------------------------------------------------- # # uid_validity # # Get the stored UIDVALIDITY value for the passed-in folder # or pass in new UIDVALIDITY value to store the value # # arguments: $folder [, $new_uidvalidity_value] # returns: the stored UIDVALIDITY value or undef if no value was stored previously #--------------------------------------------------------------------------------------------- sub uid_validity { my $self = shift; my $folder = shift or confess "gimme a folder!"; my $uidval = shift; my $all = $self->config_( 'uidvalidities' ); my %hash; if ( defined $all ) { %hash = split /$cfg_separator/, $all; } # set if ( defined $uidval ) { $hash{$folder} = $uidval; $all = ''; while ( my ( $key, $value ) = each %hash ) { $all .= "$key$cfg_separator$value$cfg_separator"; } $self->config_( 'uidvalidities', $all ); $self->log_( 1, "Updated UIDVALIDITY value for folder $folder to $uidval." ); } # get else { if ( exists $hash{$folder} ) { return $hash{$folder}; } else { return undef; } } } #--------------------------------------------------------------------------------------------- # # uid_next # # Get the stored UIDNEXT value for the passed-in folder # or pass in a new UIDNEXT value to store the value # # arguments: $folder [, $new_uidnext_value] # returns: the stored UIDVALIDITY value or undef if no value was stored previously #--------------------------------------------------------------------------------------------- sub uid_next { my $self = shift; my $folder = shift or confess "I need a folder"; my $uidnext = shift; my $all = $self->config_( 'uidnexts' ); my %hash = (); if ( defined $all ) { %hash = split /$cfg_separator/, $all; } # set if ( defined $uidnext ) { $hash{$folder} = $uidnext; $all = ''; while ( my ( $key, $value ) = each %hash ) { $all .= "$key$cfg_separator$value$cfg_separator"; } $self->config_( 'uidnexts', $all ); $self->log_( 1, "Updated UIDNEXT value for folder $folder to $uidnext." ); } # get else { if ( exists $hash{$folder} ) { return $hash{$folder}; } return; } } # ---------------------------------------------------------------------------- # # check_uidvalidity - Compare the stored UIDVALIDITY value to the passed-in # value # # IN: $folder, $uidvalidity_value # OUT: true if the values are equal, undef otherwise # ---------------------------------------------------------------------------- sub check_uidvalidity { my $self = shift; my $folder = shift or confess "gimme a folder"; my $new_val = shift or confess "gimme a new_val"; # Save old UIDVALIDITY value (if we have one) my $old_val = $self->uid_validity( $folder ); # Check whether the old value is still valid if ( $new_val != $old_val ) { return; } else { return 1; } } sub connected { my $self = shift; return $self->{socket} ? 1 : undef; } sub bail_out { my $self = shift; my $msg = shift; $self->{socket}->shutdown( 2 ) if defined $self->{socket}; $self->{socket} = undef; my ( $package, $filename, $line, $subroutine ) = caller(); $self->log_( 0, $msg ); die "POPFILE-IMAP-EXCEPTION: $msg ($filename ($line))"; } 1; |
From: Manni H. <man...@us...> - 2007-11-11 16:42:53
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6690/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Major changes: * refactored the code and created a new module that contains all the IMAP-client code. This makes the IMAP stuff much simpler to maintain. * added a method that will use only one connection to keep all our folders under control. This new mode is now the default. * did much work on the IMAP tests. coverage for the client module: 86%, for the IMAP module itself: 58%. TODO: * port this to cvs HEAD * document installation of the new module. * add yet more tests. * test in the wild Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.5 retrieving revision 1.9.4.6 diff -C2 -d -r1.9.4.5 -r1.9.4.6 *** IMAP.pm 5 Nov 2007 09:34:25 -0000 1.9.4.5 --- IMAP.pm 11 Nov 2007 16:42:54 -0000 1.9.4.6 *************** *** 2,6 **** --- 2,8 ---- package Services::IMAP; use POPFile::Module; + use Services::IMAP::Client; @ISA = ("POPFile::Module"); + use Carp; # ---------------------------------------------------------------------------- *************** *** 8,12 **** [...2353 lines suppressed...] + else { + $self->log_( 0, "Could not LOGIN." ); + $self->{imap_error} = 'NO_LOGIN'; + } + } + else { + $self->log_( 0, "Could not CONNECT to server." ); + $self->{imap_error} = 'NO_CONNECT'; + } + } + else { + $self->log_( 0, 'Could not create IMAP object!' ); + $self->{imap_error} = 'NO_OBJECT'; + } + + return; + } + + + 1; |
From: Brian S. <xue...@us...> - 2007-11-10 13:43:12
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9917 Modified Files: Tag: b0_22_2 adduser-Uninstall.nsh adduser-Version.nsh adduser.nsi installer-SecPOPFile-body.nsh installer-Uninstall.nsh installer.nsi Log Message: In order to stop Vista from ignoring the requested execution level for the POPFile uninstaller (thus rendering the UAC plugin useless), use HKCU instead of HKLM to store the uninstall data when Vista is detected. Simplify the handling of the Start Menu shortcuts to make it easier to avoid leaving some behind when uninstalling. Fix the minor bugs that sometimes meant the uninstaller had to ask for permission to delete some files which should have been deleted automatically. Index: installer-SecPOPFile-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-body.nsh,v retrieving revision 1.3.2.11 retrieving revision 1.3.2.12 diff -C2 -d -r1.3.2.11 -r1.3.2.12 *** installer-SecPOPFile-body.nsh 18 Oct 2007 01:37:38 -0000 1.3.2.11 --- installer-SecPOPFile-body.nsh 10 Nov 2007 13:43:08 -0000 1.3.2.12 *************** *** 77,86 **** ; ; (b) $INSTDIR\kakasi - holds the Kakasi package used to process Japanese email ! ; (only installed when Japanese support is required) ; ! ; (c) $INSTDIR\lib - minimal Perl installation (except for the three files stored ; in the $INSTDIR folder to avoid runtime problems) ; ! ; (d) $INSTDIR\* - the remaining POPFile folders (Classifier, languages, skins, etc) ; ; For this build, each user is expected to have separate user data folders. By default each --- 77,91 ---- ; ; (b) $INSTDIR\kakasi - holds the Kakasi package used to process Japanese email ! ; (only installed when Japanese support is required and the Kakasi ! ; parser has been selected) ; ! ; (c) $INSTDIR\mecab - holds the MeCab package used to process Japanese email ! ; (only installed when Japanese support is required and the MeCab ! ; parser has been selected) ! ; ! ; (d) $INSTDIR\lib - minimal Perl installation (except for the three files stored ; in the $INSTDIR folder to avoid runtime problems) ; ! ; (e) $INSTDIR\* - the remaining POPFile folders (Classifier, languages, skins, etc) ; ; For this build, each user is expected to have separate user data folders. By default each *************** *** 144,148 **** Call SkinsRestructure - StrCmp $G_WINUSERTYPE "Admin" 0 current_user_root WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "Installer Language" "$LANGUAGE" WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Major Version" "${C_POPFILE_MAJOR_VERSION}" --- 149,152 ---- *************** *** 163,185 **** WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_SFN" "${L_TEMP}" - current_user_root: - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "Installer Language" "$LANGUAGE" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Major Version" "${C_POPFILE_MAJOR_VERSION}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Minor Version" "${C_POPFILE_MINOR_VERSION}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Revision" "${C_POPFILE_REVISION}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile RevStatus" "${C_POPFILE_RC}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "InstallPath" "$G_ROOTDIR" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "Author" "setup.exe" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_LFN" "$G_ROOTDIR" - StrCmp $G_SFN_DISABLED "0" find_HKCU_root_sfn - StrCpy ${L_TEMP} "Not supported" - Goto save_HKCU_root_sfn - - find_HKCU_root_sfn: - GetFullPathName /SHORT ${L_TEMP} "$G_ROOTDIR" - - save_HKCU_root_sfn: - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_SFN" "${L_TEMP}" - ; Install the POPFile Core files --- 167,170 ---- *************** *** 367,381 **** ; the read-only attribute first. Similar handling is required for the Internet shortcuts. ! ; If the user has 'Admin' rights, create a 'POPFile' folder with a set of shortcuts in ! ; the 'All Users' Start Menu . If the user does not have 'Admin' rights, the shortcuts ! ; are created in the 'Current User' Start Menu. ! ; If the 'All Users' folder is not found, NSIS will return the 'Current User' folder. SetShellVarContext all - StrCmp $G_WINUSERTYPE "Admin" create_shortcuts - SetShellVarContext current - - create_shortcuts: SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}" SetOutPath "$G_ROOTDIR" --- 352,359 ---- ; the read-only attribute first. Similar handling is required for the Internet shortcuts. ! ; Create a 'POPFile' folder with a set of shortcuts in the 'All Users' Start Menu. ; If the 'All Users' folder is not found, NSIS will return the 'Current User' folder. SetShellVarContext all SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}" SetOutPath "$G_ROOTDIR" *************** *** 396,407 **** SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" NORMAL - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" \ - "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/" - - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" NORMAL - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" \ - "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/shutdown" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" NORMAL --- 374,377 ---- *************** *** 452,456 **** !endif ! IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 silent_shutdown Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL --- 422,426 ---- !endif ! IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 add_remove_programs Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL *************** *** 461,506 **** "$G_ROOTDIR\pfidiag.exe" "/full" ! silent_shutdown: SetOutPath "$G_ROOTDIR" ! ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" \ ! "$G_ROOTDIR\stop_pf.exe" "/showerrors $G_GUI" ; Create entry in the Control Panel's "Add/Remove Programs" list ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "DisplayName" "${C_PFI_PRODUCT} ${C_PFI_VERSION}" ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "InstallLocation" "$G_ROOTDIR" ! WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "NoModify" "0" ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' ! WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "NoElevateOnModify" "1" ! WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "NoRepair" "1" ! StrCmp $G_WINUSERTYPE "Admin" 0 end_section ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "DisplayName" "${C_PFI_PRODUCT} ${C_PFI_VERSION}" ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "InstallLocation" "$G_ROOTDIR" ! WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoModify" "0" ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' ! WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoElevateOnModify" "1" ! WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoRepair" "1" ! end_section: SetDetailsPrint textonly DetailPrint "$(PFI_LANG_INST_PROG_ENDSEC)" --- 431,467 ---- "$G_ROOTDIR\pfidiag.exe" "/full" ! add_remove_programs: SetOutPath "$G_ROOTDIR" ! SetShellVarContext current ; Create entry in the Control Panel's "Add/Remove Programs" list ! ClearErrors ! ReadRegStr ${L_RESULT} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion ! IfErrors use_HKLM ! StrCpy ${L_TEMP} ${L_RESULT} 1 ! StrCmp ${L_TEMP} '6' create_arp_entry ! use_HKLM: ! SetShellVarContext all ! create_arp_entry: ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "DisplayName" "${C_PFI_PRODUCT} ${C_PFI_VERSION}" ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "InstallLocation" "$G_ROOTDIR" ! WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoModify" "0" ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' ! WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoElevateOnModify" "1" ! WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoRepair" "1" ! SetShellVarContext current ! SetDetailsPrint textonly DetailPrint "$(PFI_LANG_INST_PROG_ENDSEC)" Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.15 retrieving revision 1.242.4.16 diff -C2 -d -r1.242.4.15 -r1.242.4.16 *** installer.nsi 18 Oct 2007 01:40:24 -0000 1.242.4.15 --- installer.nsi 10 Nov 2007 13:43:08 -0000 1.242.4.16 *************** *** 592,600 **** ;--------------------------------------------------- ! ; Use a "pre" function for the 'WELCOME' page to get the user name and user rights ! ; (For this build, if user has 'Admin' rights we perform a multi-user install, ! ; otherwise we perform a single-user install) ! !define MUI_PAGE_CUSTOMFUNCTION_PRE "CheckUserRights" !define MUI_WELCOMEPAGE_TEXT "$(PFI_LANG_WELCOME_INFO_TEXT)" --- 592,599 ---- ;--------------------------------------------------- ! ; Use a "pre" function for the 'WELCOME' page to remove the banner ! ; (if one has been displayed) ! !define MUI_PAGE_CUSTOMFUNCTION_PRE "RemoveBanner" !define MUI_WELCOMEPAGE_TEXT "$(PFI_LANG_WELCOME_INFO_TEXT)" *************** *** 906,923 **** Function .onInit ; Use the UAC plugin to ensure that this installer runs with 'administrator' privileges ; (UAC = Vista's new "User Account Control" feature). - ; - ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers UAC_Elevate: UAC::RunElevated ! StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user? ! StrCmp 0 $0 0 UAC_Err ; Error? ! StrCmp 1 $1 0 UAC_Success ; Are we the real deal or just the wrapper? ! Quit UAC_Err: ! MessageBox mb_iconstop "Unable to elevate , error $0" Abort --- 905,973 ---- Function .onInit + ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers + + !define L_UAC_0 $0 + !define L_UAC_1 $1 + !define L_UAC_2 $2 + !define L_UAC_3 $3 + + ; The reason why '.onInit' preserves the registers it uses is that it makes debugging easier! + + Push ${L_UAC_0} + Push ${L_UAC_1} + Push ${L_UAC_2} + Push ${L_UAC_3} + + ; Initialise the G_WINUSERNAME and $G_WINUSERTYPE globals _before_ trying to elevate + ; as this makes it easier to cope with the visible and hidden processes after elevation + + ; The 'UserInfo' plugin may return an error if run on a Win9x system but since Win9x systems + ; do not support different account types, we treat this error as if user has 'Admin' rights. + + ClearErrors + UserInfo::GetName + IfErrors 0 got_name + + ; Assume Win9x system, so user has 'Admin' rights + ; (UserInfo works on Win98SE so perhaps it is only Win95 that fails ?) + + StrCpy $G_WINUSERNAME "UnknownUser" + StrCpy $G_WINUSERTYPE "Admin" + Goto UAC_Elevate + + got_name: + Pop $G_WINUSERNAME + StrCmp $G_WINUSERNAME "" 0 get_usertype + StrCpy $G_WINUSERNAME "UnknownUser" + + get_usertype: + UserInfo::GetAccountType + Pop $G_WINUSERTYPE + StrCmp $G_WINUSERTYPE "Admin" UAC_Elevate + StrCmp $G_WINUSERTYPE "Power" UAC_Elevate + StrCmp $G_WINUSERTYPE "User" UAC_Elevate + StrCmp $G_WINUSERTYPE "Guest" UAC_Elevate + StrCpy $G_WINUSERTYPE "Unknown" + ; Use the UAC plugin to ensure that this installer runs with 'administrator' privileges ; (UAC = Vista's new "User Account Control" feature). UAC_Elevate: + ; MessageBox MB_OK "Debug message (UAC_Elevate label in .onInit function)\ + ; ${MB_NL}${MB_NL}\ + ; Command-line = $CMDLINE\ + ; ${MB_NL}${MB_NL}\ + ; $$G_WINUSERNAME = $G_WINUSERNAME\ + ; ${MB_NL}${MB_NL}\ + ; $$G_WINUSERTYPE = $G_WINUSERTYPE" + UAC::RunElevated ! StrCmp 1223 ${L_UAC_0} UAC_ElevationAborted ; Jump if UAC dialog was aborted by user ! StrCmp 0 ${L_UAC_0} 0 UAC_Err ; If ${L_UAC_0} is not 0 then an error was detected ! StrCmp 1 ${L_UAC_1} 0 UAC_Success ; Are we the real deal or just the wrapper ? ! Quit ; UAC not supported (probably pre-NT6), run as normal UAC_Err: ! MessageBox mb_iconstop "Unable to elevate , error ${L_UAC_0}" Abort *************** *** 927,942 **** UAC_Success: ! # if $0==0 && $1==0, UAC not supported (Probably <NT6), run as normal? ! # if $0==0 && $1==3, we can try to elevate again ! # if $0==0 && $3==1, we are a member of the admin group (Any OS) ! StrCmp 1 $3 continue ; Admin? ! StrCmp 3 $1 0 UAC_ElevationAborted ; Try again? MessageBox mb_iconstop "This installer requires admin access, try again" ! goto UAC_Elevate continue: - ; The reason why '.onInit' preserves the registers it uses is that it makes debugging easier! - !define L_INPUT_FILE_HANDLE $R9 !define L_OUTPUT_FILE_HANDLE $R8 --- 977,987 ---- UAC_Success: ! StrCmp 1 ${L_UAC_3} continue ; Jump if we are a member of the admin group (any OS) ! StrCmp 3 ${L_UAC_1} 0 UAC_ElevationAborted ; Can we try to elevate again ? MessageBox mb_iconstop "This installer requires admin access, try again" ! goto UAC_Elevate ; ... try again continue: !define L_INPUT_FILE_HANDLE $R9 !define L_OUTPUT_FILE_HANDLE $R8 *************** *** 986,989 **** --- 1031,1044 ---- !undef L_TEMP + Pop ${L_UAC_3} + Pop ${L_UAC_2} + Pop ${L_UAC_1} + Pop ${L_UAC_0} + + !undef L_UAC_0 + !undef L_UAC_1 + !undef L_UAC_2 + !undef L_UAC_3 + FunctionEnd *************** *** 1057,1061 **** ; in two stages (first an empty MUI page appears and a little later the page contents appear). ; This looks a little strange (and may prompt the user to start clicking buttons too soon) ! ; so we display a banner to reassure the user. The banner will be removed by 'CheckUserRights' StrCpy $G_PFIFLAG "banner displayed" --- 1112,1116 ---- ; in two stages (first an empty MUI page appears and a little later the page contents appear). ; This looks a little strange (and may prompt the user to start clicking buttons too soon) ! ; so we display a banner to reassure the user. The banner will be removed by 'RemoveBanner' StrCpy $G_PFIFLAG "banner displayed" *************** *** 1854,1913 **** #-------------------------------------------------------------------------- ! # Installer Function: CheckUserRights # (the "pre" function for the 'WELCOME' page) - # - # On systems which support different types of user, recommend that POPFile is installed by - # a user with 'Administrative' rights (this makes it easier to use POPFile's multi-user mode). #-------------------------------------------------------------------------- ! Function CheckUserRights ! ! !define L_WELCOME_TEXT $R9 ! ! Push ${L_WELCOME_TEXT} ! ! ; The 'UserInfo' plugin may return an error if run on a Win9x system but since Win9x systems ! ; do not support different account types, we treat this error as if user has 'Admin' rights. ! ! ClearErrors ! UserInfo::GetName ! IfErrors 0 got_name ! ! ; Assume Win9x system, so user has 'Admin' rights ! ; (UserInfo works on Win98SE so perhaps it is only Win95 that fails ?) ! ! StrCpy $G_WINUSERNAME "UnknownUser" ! StrCpy $G_WINUSERTYPE "Admin" ! Goto exit ! ! got_name: ! Pop $G_WINUSERNAME ! StrCmp $G_WINUSERNAME "" 0 get_usertype ! StrCpy $G_WINUSERNAME "UnknownUser" ! ! get_usertype: ! UserInfo::GetAccountType ! Pop $G_WINUSERTYPE ! StrCmp $G_WINUSERTYPE "Admin" exit ! StrCmp $G_WINUSERTYPE "Power" not_admin ! StrCmp $G_WINUSERTYPE "User" not_admin ! StrCmp $G_WINUSERTYPE "Guest" not_admin ! StrCpy $G_WINUSERTYPE "Unknown" ! ! not_admin: ! ! ; On the 'WELCOME' page, add a note recommending that POPFile is installed by a user ! ; with 'Administrator' rights ! ! !insertmacro MUI_INSTALLOPTIONS_READ "${L_WELCOME_TEXT}" "ioSpecial.ini" "Field 3" "Text" ! !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" \ ! "${L_WELCOME_TEXT}\ ! ${IO_NL}${IO_NL}\ ! $(PFI_LANG_WELCOME_ADMIN_TEXT)" ! ! exit: ! Pop ${L_WELCOME_TEXT} ! StrCmp $G_PFIFLAG "no banner" no_banner ; Remove the banner which was displayed by the 'PFIGUIInit' function --- 1909,1919 ---- #-------------------------------------------------------------------------- ! # Installer Function: RemoveBanner # (the "pre" function for the 'WELCOME' page) #-------------------------------------------------------------------------- ! Function RemoveBanner ! StrCmp $G_PFIFLAG "no banner" exit ; Remove the banner which was displayed by the 'PFIGUIInit' function *************** *** 1916,1922 **** Banner::destroy ! no_banner: ! ! !undef L_WELCOME_TEXT FunctionEnd --- 1922,1926 ---- Banner::destroy ! exit: FunctionEnd *************** *** 2178,2181 **** --- 2182,2187 ---- Function InstallUserData + !define L_UAC_0 $0 + ; If we are only downloading and installing the SSL support files, display the FINISH page *************** *** 2193,2201 **** --- 2199,2211 ---- IfRebootFlag special_case + Push ${L_UAC_0} UAC::Exec "" "$G_ROOTDIR\adduser.exe" "/install" "" + Pop ${L_UAC_0} Abort special_case: + Push ${L_UAC_0} UAC::Exec "" "$G_ROOTDIR\adduser.exe" "/installreboot" "" + Pop ${L_UAC_0} Abort *************** *** 2204,2207 **** --- 2214,2219 ---- ; Display the FINISH page + !undef L_UAC_0 + FunctionEnd Index: adduser-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-Uninstall.nsh,v retrieving revision 1.2.2.6 retrieving revision 1.2.2.7 diff -C2 -d -r1.2.2.6 -r1.2.2.7 *** adduser-Uninstall.nsh 21 Sep 2007 01:22:09 -0000 1.2.2.6 --- adduser-Uninstall.nsh 10 Nov 2007 13:43:08 -0000 1.2.2.7 *************** *** 447,450 **** --- 447,451 ---- Delete "$G_USERDIR\pfi-run.bat" + Delete "$G_USERDIR\pfi-run.bat.bk?" SetDetailsPrint textonly *************** *** 462,482 **** StrCmp $G_PFIFLAG "fail" do_nothing SetDetailsPrint textonly DetailPrint "$(PFI_LANG_UN_PROG_SHORT)" SetDetailsPrint listonly Delete "$G_USERDIR\Check database status.lnk" Delete "$G_USERDIR\Run SQLite utility.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Check database status.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Message Capture utility.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile Data ($G_WINUSERNAME).lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}" SetDetailsPrint textonly DetailPrint " " SetDetailsPrint listonly do_nothing: SectionEnd --- 463,513 ---- StrCmp $G_PFIFLAG "fail" do_nothing + !define L_TEMP $R9 + + Push ${L_TEMP} + SetDetailsPrint textonly DetailPrint "$(PFI_LANG_UN_PROG_SHORT)" SetDetailsPrint listonly + ; Remove the utility shortcuts in the 'User Data' folder + Delete "$G_USERDIR\Check database status.lnk" Delete "$G_USERDIR\Run SQLite utility.lnk" ! ! ; Remove the POPFile shortcuts from the current user's Start Menu ! ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Message Capture utility.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Check database status.lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" + + Call un.PFI_IsNT + Pop ${L_TEMP} + StrCmp ${L_TEMP} 1 remove_all + IfFileExists "$G_ROOTDIR\uninstall.exe" remove_most + + remove_all: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Release Notes.lnk" + + remove_most: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile Data ($G_WINUSERNAME).lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}" + Delete "$SMSTARTUP\Run POPFile.lnk" + SetDetailsPrint textonly DetailPrint " " SetDetailsPrint listonly + Pop ${L_TEMP} + + !undef L_TEMP + do_nothing: SectionEnd Index: installer-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-Uninstall.nsh,v retrieving revision 1.4.2.13 retrieving revision 1.4.2.14 diff -C2 -d -r1.4.2.13 -r1.4.2.14 *** installer-Uninstall.nsh 20 Oct 2007 13:02:07 -0000 1.4.2.13 --- installer-Uninstall.nsh 10 Nov 2007 13:43:08 -0000 1.4.2.14 *************** *** 64,78 **** Function un.onInit ; Use the UAC plugin to ensure that this uninstaller runs with 'administrator' privileges ; (UAC = Vista's new "User Account Control" feature). - ; - ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers UAC_Elevate: UAC::RunElevated ! StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user? ! StrCmp 0 $0 0 UAC_Err ; Error? ! StrCmp 1 $1 0 UAC_Success ; Are we the real deal or just the wrapper? ! Quit UAC_Err: --- 64,90 ---- Function un.onInit + ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers + + !define L_UAC_0 $0 + !define L_UAC_1 $1 + !define L_UAC_2 $2 + !define L_UAC_3 $3 + + ; The reason why 'un.onInit' preserves the registers it uses is that it makes debugging easier! + + Push ${L_UAC_0} + Push ${L_UAC_1} + Push ${L_UAC_2} + Push ${L_UAC_3} + ; Use the UAC plugin to ensure that this uninstaller runs with 'administrator' privileges ; (UAC = Vista's new "User Account Control" feature). UAC_Elevate: UAC::RunElevated ! StrCmp 1223 ${L_UAC_0} UAC_ElevationAborted ; Jump if UAC dialog was aborted by user ! StrCmp 0 ${L_UAC_0} 0 UAC_Err ; If ${L_UAC_0} is not 0 then an error was detected ! StrCmp 1 ${L_UAC_1} 0 UAC_Success ; Are we the real deal or just the wrapper ? ! Quit ; UAC not supported (probably pre-NT6), run as normal UAC_Err: *************** *** 85,92 **** UAC_Success: ! StrCmp 1 $3 continue ; Admin? ! StrCmp 3 $1 0 UAC_ElevationAborted ; Try again or abort? ! MessageBox MB_OK|MB_ICONSTOP "This uninstaller requires admin access, try again" ; Inform user... ! goto UAC_Elevate ; ... and try again continue: --- 97,104 ---- UAC_Success: ! StrCmp 1 ${L_UAC_3} continue ; Jump if we are a member of the admin group (any OS) ! StrCmp 3 ${L_UAC_1} 0 UAC_ElevationAborted ; Can we try to elevate again ? ! MessageBox MB_OK|MB_ICONSTOP "This uninstaller requires admin access, try again" ! goto UAC_Elevate ; ... try again continue: *************** *** 102,108 **** !insertmacro MUI_UNGETLANGUAGE - StrCpy $G_ROOTDIR "$INSTDIR" - StrCpy $G_MPLIBDIR "$INSTDIR\lib" - Call un.SetGlobalUserVariables --- 114,117 ---- *************** *** 110,113 **** --- 119,132 ---- !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioUM.ini" + Pop ${L_UAC_3} + Pop ${L_UAC_2} + Pop ${L_UAC_1} + Pop ${L_UAC_0} + + !undef L_UAC_0 + !undef L_UAC_1 + !undef L_UAC_2 + !undef L_UAC_3 + FunctionEnd *************** *** 117,123 **** # Used to initialise (or re-initialise) the following global variables: # ! # (1) $G_USERDIR - full path to the folder containing the 'popfile.cfg' file ! # (2) $G_WINUSERNAME - current Windows user login name ! # (3) $G_WINUSERTYPE - user group ('Admin', 'Power', 'User', 'Guest' or 'Unknown') # # (this helps avoid problems when the uninstaller is started by a non-admin user) --- 136,144 ---- # Used to initialise (or re-initialise) the following global variables: # ! # (1) $G_ROOTDIR - full path to the folder containing the POPFile program files ! # (2) $G_MPLIBDIR - full path to the folder containing the minimal Perl ! # (3) $G_USERDIR - full path to the folder containing the 'popfile.cfg' file ! # (4) $G_WINUSERNAME - current Windows user login name ! # (5) $G_WINUSERTYPE - user group ('Admin', 'Power', 'User', 'Guest' or 'Unknown') # # (this helps avoid problems when the uninstaller is started by a non-admin user) *************** *** 126,129 **** --- 147,153 ---- Function un.SetGlobalUserVariables + StrCpy $G_ROOTDIR "$INSTDIR" + StrCpy $G_MPLIBDIR "$INSTDIR\lib" + ; Starting with 0.21.0 the registry is used to store the location of the 'User Data' ; (if setup.exe or adduser.exe was used to create/update the 'User Data' for this user) *************** *** 1061,1064 **** --- 1085,1092 ---- skip_XMLRPC_support: + IfFileExists "$G_MPLIBDIR\Net\SSLeay\*.*" 0 skip_SSL_support + RMDir /r "$G_MPLIBDIR\Net" + + skip_SSL_support: RMDir /r "$G_MPLIBDIR\auto" RMDir /r "$G_MPLIBDIR\Carp" *************** *** 1117,1129 **** ; Only remove registry data if it matches what we are uninstalling ! StrCmp $G_WINUSERTYPE "Admin" check_HKLM_data ; Uninstalluser.exe deletes all HKCU registry data except for the 'Add/Remove Programs' entry ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" ! StrCmp ${L_REGDATA} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 section_exit DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" ! Goto section_exit check_HKLM_data: --- 1145,1164 ---- ; Only remove registry data if it matches what we are uninstalling ! ClearErrors ! ReadRegStr ${L_REGDATA} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion ! IfErrors check_HKLM_data ! StrCpy ${L_REGDATA} ${L_REGDATA} 1 ! StrCmp ${L_REGDATA} '6' 0 check_HKLM_data ; Uninstalluser.exe deletes all HKCU registry data except for the 'Add/Remove Programs' entry ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" ! StrCmp ${L_REGDATA} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 real_user DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" ! ! real_user: ! GetFunctionAddress ${L_REGDATA} un.DeleteDataFromHKCU ! UAC::ExecCodeSegment ${L_REGDATA} check_HKLM_data: *************** *** 1154,1157 **** --- 1189,1214 ---- #-------------------------------------------------------------------------- + # Uninstaller Function: 'un.DeleteDataFromHKCU' + #-------------------------------------------------------------------------- + + Function un.DeleteDataFromHKCU + + !define L_REGDATA $R9 + + Push ${L_REGDATA} + + ReadRegStr ${L_REGDATA} HKCU \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" + StrCmp ${L_REGDATA} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 exit + DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" + + exit: + Pop ${L_REGDATA} + + !undef L_REGDATA + + FunctionEnd + + #-------------------------------------------------------------------------- # Uninstaller Section: 'un.Uninstall End' (this is the penultimate section in the uninstaller) # Index: adduser-Version.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-Version.nsh,v retrieving revision 1.6.2.16 retrieving revision 1.6.2.17 diff -C2 -d -r1.6.2.16 -r1.6.2.17 *** adduser-Version.nsh 5 Oct 2007 18:28:45 -0000 1.6.2.16 --- adduser-Version.nsh 10 Nov 2007 13:43:08 -0000 1.6.2.17 *************** *** 7,11 **** #-------------------------------------------------------------------------- ! !define C_PFI_VERSION "0.3.13" #-------------------------------------------------------------------------- --- 7,11 ---- #-------------------------------------------------------------------------- ! !define C_PFI_VERSION "0.3.17" #-------------------------------------------------------------------------- Index: adduser.nsi =================================================================== RCS file: /cvsroot/popfile/windows/adduser.nsi,v retrieving revision 1.59.4.18 retrieving revision 1.59.4.19 diff -C2 -d -r1.59.4.18 -r1.59.4.19 *** adduser.nsi 14 Oct 2007 17:49:20 -0000 1.59.4.18 --- adduser.nsi 10 Nov 2007 13:43:08 -0000 1.59.4.19 *************** *** 724,727 **** --- 724,728 ---- ReserveFile "${NSISDIR}\Plugins\Banner.dll" ReserveFile "${NSISDIR}\Plugins\LockedList.dll" + ReserveFile "${NSISDIR}\Plugins\MoreInfo.dll" ReserveFile "${NSISDIR}\Plugins\nsExec.dll" ReserveFile "${NSISDIR}\Plugins\NSISdl.dll" *************** *** 944,950 **** --- 945,960 ---- IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" 0 update_HKCU_data IfFileExists "$G_ROOTDIR\uninstall.exe" 0 update_HKCU_data + ClearErrors + ReadRegStr ${L_TEMP} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors update_AllUsers_uninstall + StrCpy ${L_TEMP} ${L_TEMP} 1 + StrCmp ${L_TEMP} '6' update_HKCU_data + + update_AllUsers_uninstall: + SetShellVarContext all SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" \ "$G_ROOTDIR\uninstall.exe" + SetShellVarContext current update_HKCU_data: *************** *** 1205,1256 **** "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/shutdown" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" NORMAL - - !ifndef ENGLISH_MODE - StrCmp $LANGUAGE ${LANG_JAPANESE} japanese_faq - !endif - - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki/FAQ" - - !ifndef ENGLISH_MODE - Goto support - - japanese_faq: - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki/JP:FAQ" - - support: - !endif - SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" NORMAL - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" \ - "InternetShortcut" "URL" "http://getpopfile.org/" - - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" NORMAL - - !ifndef ENGLISH_MODE - StrCmp $LANGUAGE ${LANG_JAPANESE} japanese_wiki - !endif - - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki" - - !ifndef ENGLISH_MODE - Goto pfidiagnostic - - japanese_wiki: - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki/jp" - - pfidiagnostic: - !endif - IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" 0 pfidiag_entries SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" NORMAL --- 1215,1220 ---- *************** *** 1261,1270 **** IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 msgcapture_entry Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" "/full" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" \ --- 1225,1234 ---- IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 msgcapture_entry Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" ! ; SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL ! ; CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! ; "$G_ROOTDIR\pfidiag.exe" ! ; SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" NORMAL ! ; CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! ; "$G_ROOTDIR\pfidiag.exe" "/full" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" \ *************** *** 1309,1313 **** end_autostart_set: ! ; Create entry in the Control Panel's "Add/Remove Programs" list WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}_Data" \ --- 1273,1277 ---- end_autostart_set: ! ; Create "User Data" entry in the Control Panel's "Add/Remove Programs" list WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}_Data" \ *************** *** 1322,1325 **** --- 1286,1316 ---- "NoRepair" "1" + ; Create "POPFile" (program) entry in "Add/Remove Programs" list (if target is Vista) + + IfFileExists "$G_ROOTDIR\uninstall.exe" 0 all_done + ClearErrors + ReadRegStr ${L_TEMP} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors all_done + StrCpy ${L_TEMP} ${L_TEMP} 1 + StrCmp ${L_TEMP} '6' 0 all_done + + MoreInfo::GetFileVersion "$G_ROOTDIR\uninstall.exe" + Pop ${L_TEMP} + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "DisplayName" "${C_PFI_PRODUCT} ${L_TEMP}" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "InstallLocation" "$G_ROOTDIR" + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "NoModify" "0" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "NoElevateOnModify" "1" + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "NoRepair" "1" + + all_done: SetDetailsPrint textonly DetailPrint "$(PFI_LANG_BE_PATIENT)" |
From: Brian S. <xue...@us...> - 2007-11-10 13:32:09
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9174 Modified Files: Tag: b0_22_2 installer-SecPOPFile-func.nsh Log Message: Add some more detail to the log. Index: installer-SecPOPFile-func.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-func.nsh,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** installer-SecPOPFile-func.nsh 20 Oct 2007 13:02:07 -0000 1.1.2.9 --- installer-SecPOPFile-func.nsh 10 Nov 2007 13:32:12 -0000 1.1.2.10 *************** *** 324,328 **** ReadRegStr $G_ROOTDIR HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "UAC_RootDir" StrCmp $G_ROOTDIR "" try_other_entries ! MessageBox MB_OK|MB_ICONINFORMATION "Good News: UAC_RootDir now defined" Goto check_folder_exists --- 324,328 ---- ReadRegStr $G_ROOTDIR HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "UAC_RootDir" StrCmp $G_ROOTDIR "" try_other_entries ! MessageBox MB_OK|MB_ICONINFORMATION "Good News: UAC_RootDir now defined ($G_ROOTDIR)" Goto check_folder_exists |
From: Brian S. <xue...@us...> - 2007-11-10 13:30:12
|
Update of /cvsroot/popfile/windows/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8070 Modified Files: Tag: b0_22_2 pfidiag.nsi Log Message: Remove a spurious blank line from the end of the report. Index: pfidiag.nsi =================================================================== RCS file: /cvsroot/popfile/windows/test/pfidiag.nsi,v retrieving revision 1.8.4.10 retrieving revision 1.8.4.11 diff -C2 -d -r1.8.4.10 -r1.8.4.11 *** pfidiag.nsi 5 Oct 2007 18:40:19 -0000 1.8.4.10 --- pfidiag.nsi 10 Nov 2007 13:30:13 -0000 1.8.4.11 *************** *** 104,108 **** ;-------------------------------------------------------------------------- ! !define C_VERSION "0.1.8" !define C_OUTFILE "pfidiag.exe" --- 104,108 ---- ;-------------------------------------------------------------------------- ! !define C_VERSION "0.1.9" !define C_OUTFILE "pfidiag.exe" *************** *** 1241,1245 **** StrCmp $G_DIAG_MODE "simple" section_end ! StrCmp ${L_MECABRC} "" exit_with_blank_line StrCpy ${L_TEMP} "" IfFileExists "${L_MECABRC}" display_mecab_result --- 1241,1245 ---- StrCmp $G_DIAG_MODE "simple" section_end ! StrCmp ${L_MECABRC} "" section_end StrCpy ${L_TEMP} "" IfFileExists "${L_MECABRC}" display_mecab_result *************** *** 1248,1253 **** display_mecab_result: DetailPrint "'mecabrc' file = ${L_TEMP}found" - - exit_with_blank_line: DetailPrint "" --- 1248,1251 ---- |
From: Manni H. <man...@us...> - 2007-11-09 14:02:07
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19794 Modified Files: Tag: b0_22_2 tests.pl Log Message: Fix indentation and get rid of tabs. Index: tests.pl =================================================================== RCS file: /cvsroot/popfile/engine/tests.pl,v retrieving revision 1.48.4.1 retrieving revision 1.48.4.2 diff -C2 -d -r1.48.4.1 -r1.48.4.2 *** tests.pl 7 Feb 2006 11:09:54 -0000 1.48.4.1 --- tests.pl 9 Nov 2007 14:02:05 -0000 1.48.4.2 *************** *** 35,53 **** my $ok = 1; ! my $subref = ! sub { ! my $f = $_; ! my $t = $f; ! $t =~ s/^$from/$to/; if ( -d $f ) { mkdir $t ; } else { ! copy( $f, $t) or $ok = 0; } }; my %optref = ( wanted => $subref, no_chdir => 1 ); find ( \%optref , $from ); ! return $ok; } --- 35,53 ---- my $ok = 1; ! my $subref = ! sub { ! my $f = $_; ! my $t = $f; ! $t =~ s/^$from/$to/; if ( -d $f ) { mkdir $t ; } else { ! copy( $f, $t) or $ok = 0; } }; my %optref = ( wanted => $subref, no_chdir => 1 ); find ( \%optref , $from ); ! return $ok; } *************** *** 97,118 **** sub test_report { ! my ( $ok, $test, $file, $line, $context ) = @_; ! spin( $line ); ! $test_count += 1; ! if ( !$ok ) { ! $fail_messages .= "\n $file:$line failed '$test'"; ! if ( defined( $context ) ) { ! $fail_messages .= " ($context)"; ! } ! $test_failures += 1; ! print "Test fail at $file:$line ($test) ($context)\n"; ! } else { ! # print "Test pass at $file:$line ($test) ($context)\n"; } ! flush STDOUT; } --- 97,118 ---- sub test_report { ! my ( $ok, $test, $file, $line, $context ) = @_; ! spin( $line ); ! $test_count += 1; ! if ( !$ok ) { ! $fail_messages .= "\n $file:$line failed '$test'"; ! if ( defined( $context ) ) { ! $fail_messages .= " ($context)"; } + $test_failures += 1; + print "Test fail at $file:$line ($test) ($context)\n"; + } else { + # print "Test pass at $file:$line ($test) ($context)\n"; + } ! flush STDOUT; } |