diff -r eprints-2.3.4/CHANGELOG eprints-2.3.6/CHANGELOG 1941a1942,1944 > ====================================================================== > 06/07/2004 - EPRINTS-2.3.4 > ====================================================================== 1942a1946,1988 > 2004-08-06 cjg > > - Added Hungarian chars to freetext index map > - New options to indexer --once, --notdaemon, --loglevel, --rollcount > - Indexer now creates log files > - Commented-out un-needed command in SearchExpression > - Fixed xmlns filtering so it only occurs on XHTML output, not XML > - Fixed a call in Config to use AnApache, so it'll work with v1.3 & 2 > - Fixed a bug in MetaField/Set; it didn't show the currently > selected value in any/all menus. > - documents_url option removed. It's hardwired to /archive/ in lots > of places. > - Added support for short URLs for records, so you can use > /33/ instead of /archive/00000033/ > - added config option 'shorturl' to make the short version the > canonnical one. > > 2004-08-06 cjg > > - Added code to SQL prepare and do so that it tries to reconnect > if the mysql connection goes away (not yet for 'execute' however) > - Modified Fulltext field type to cache extracted index codes to > reduce CPU load. > > 2004-08-06 cjg > > - Fixed spelling mistake in Fulltext.pm > - Made noxmlns actually cause/not cause xmlns to be stripped in > XML to_string (bug fix) > > ====================================================================== > 06/08/2004 - EPRINTS-2.3.5 > ====================================================================== > > 2004-08-09 cjg > > - Fixed a bug introduced last version which failed to render buttons > which id's started with "_". (Such as those on the staff eprint > edit page.) > > ====================================================================== > 09/08/2004 - EPRINTS-2.3.6 > ====================================================================== diff -r eprints-2.3.4/VERSION eprints-2.3.6/VERSION 1,2c1,2 < 2.3.4 < EPrints 2.3.4 (Chesed) [Born on 2004-07-06] --- > 2.3.6 > EPrints 2.3.6 (Tiphareth) [Born on 2004-08-09] diff -r eprints-2.3.4/bin/configure_archive eprints-2.3.6/bin/configure_archive 90c90 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/create_tables eprints-2.3.6/bin/create_tables 88c88 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/create_user eprints-2.3.6/bin/create_user 122c122 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/erase_archive eprints-2.3.6/bin/erase_archive 112c112 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/explain_sql_tables eprints-2.3.6/bin/explain_sql_tables 82c82 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/export_hashes eprints-2.3.6/bin/export_hashes 105c105 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/force_config_reload eprints-2.3.6/bin/force_config_reload 89c89 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/generate_abstracts eprints-2.3.6/bin/generate_abstracts 87c87 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/generate_apacheconf eprints-2.3.6/bin/generate_apacheconf 120c120 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/generate_static eprints-2.3.6/bin/generate_static 123c123 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/generate_views eprints-2.3.6/bin/generate_views 90c90 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 484c484 < print FILE EPrints::XML::to_string( $page ); --- > print FILE EPrints::XML::to_string( $page, undef, 1 ); 577c577 < print FILE EPrints::XML::to_string( $page ); --- > print FILE EPrints::XML::to_string( $page, undef, 1 ); diff -r eprints-2.3.4/bin/import_subjects eprints-2.3.6/bin/import_subjects 42a43,44 > Without the B<--force> option, this script asks for confirmation before actually erasing anything. > 89a92,95 > =item B<--force> > > Don't ask before making the changes. > 167c173 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/indexer eprints-2.3.6/bin/indexer 1c1 < #!/usr/bin/perl -I/opt/ep2stable/perl_lib --- > #!/usr/bin/perl -I/opt/ep2stable/perl_lib -d:DProf 30c30 < B - ??? --- > B - Indexing daemon for EPrints 34c34 < B start [B] --- > B start [B] 36c36 < B stop [B] --- > B stop 38c38 < B status [B] --- > B status 42c42 < ??? --- > This daemon runs in the background and creates index files for all eprints archives. It builds indexes for each archive in turn then starts again. 44c44 < =over 8 --- > Messages and errors are logged to /opt/eprints2/var/indexer.log unless you change the log options. If it appears to be having problems try raising the log level and examining the log. 46c46 < =item B --- > Once all the archives have been indexed, the indexer rolls the logs (up to logfile.5) and then starts again. See --rollcount for ways to customise this. 48c48 < The ID of the eprint archive to rehash the documents of. --- > =over 8 78a79,126 > =item B<--logfile> I > > Log to I rather than default indexer log. > > =item B<--loglevel> I > > Set the level of detail to log. Level may be 0-5. > > =over 8 > > =item 0 > > Do not log anything. > > =item 1 > > Report start, stop and errors. > > =item 2 [default] > > All above, plus report names of archives being indexed and warnings. > > =item 3 > > All above, plus report processes starting and stopping and each dataset being indexed. > > =item 4 > > All above, plus report details of index process. > > =item 5 > > All above, plus report id of every item indexed. > > =back > > =item B<--rollcount> I > > Set the number of once-through logs that should be kept. If set to zero then indexer will never roll the logs but rather just keep writing to the main log. > > =item B<--notdaemon> > > Do not become a daemon, remain attached to the current terminal (errors still go to the log file). > > =item B<--once> > > Only index each archive once rather than loop for ever. > 91c139 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 142a191 > 143a193,197 > my $logfile; > my $loglevel = 2; > my $rollcount = 5; > my $notdaemon = 0; > my $once = 0; 152c206,211 < 'quiet' => \$quiet --- > 'quiet' => \$quiet, > 'notdaemon' => \$notdaemon, > 'once' => \$once, > 'rollcount=s' => \$rollcount, > 'logfile=s' => \$logfile, > 'loglevel=s' => \$loglevel 164c223,236 < my $pidfile = EPrints::Config::get("var_path")."/indexer.pid"; --- > my $p = { > loglevel => $loglevel+0, > rollcount => $rollcount+0, > daemon => !$notdaemon, > noise => $noise, > once => $once, > logfile => $logfile > }; > > $p->{pidfile} = EPrints::Config::get("var_path")."/indexer.pid"; > if( !defined $p->{logfile} ) > { > $p->{logfile} = EPrints::Config::get("var_path")."/indexer.log"; > } 168c240 < if( !-e $pidfile ) --- > if( !-e $p->{pidfile} ) 174,175c246 < < my $pid = get_pid( $pidfile, $noise ); --- > my $pid = get_pid( $p ); 183c254 < if( !-e $pidfile ) --- > if( !-e $p->{pidfile} ) 186c257 < $pidfile does not appear to exist. --- > $p->{pidfile} does not appear to exist. 194c265 < my $pid = get_pid( $pidfile, $noise ); --- > my $pid = get_pid( $p ); 198c269 < die "Could not find PID in $pidfile. Weird. Better kill it by hand."; --- > die "Could not find PID in $p->{pidfile}. Weird. Better kill it by hand."; 202c273 < print "Sending TERM signal to $pid\n" if( $noise > 1 ); --- > print "Sending TERM signal to $pid\n" if( $p->{noise} > 1 ); 210c281 < if( !-e $pidfile ) --- > if( !-e $p->{pidfile} ) 212c283 < print "...Killed $pid\n" if( $noise > 1 ); --- > print "...Killed $pid\n" if( $p->{noise} > 1 ); 216c287 < print "tick\n" if( $noise > 2 ); --- > print "tick\n" if( $p->{noise} > 2 ); 222c293 < then removing $pidfile --- > then removing $p->{pidfile} 242c313 < if( !$force && -e $pidfile ) --- > if( !$force && -e $p->{pidfile} ) 244c315 < my $pid = get_pid( $pidfile, $noise ); --- > my $pid = get_pid( $p ); 260c331 < * delete the PID file: $pidfile --- > * delete the PID file: $p->{pidfile} 267,270d337 < < print "Becoming a daemon. Go me.\n" if( $noise > 1 ); < close STDIN; < close STDOUT; 272,273c339,349 < exit if fork; < exit if fork; --- > if( $p->{loglevel} > 0 ) > { > open( STDERR, ">>$p->{logfile}" ) || die "Error opening $p->{logfile}: $!"; > select( STDERR ); > $| = 1; > > rolllogs( $p ); > indexlog(); > indexlog(); > indexlog( "**** Indexer starting..." ); > } 275a352,360 > if( $p->{daemon} ) > { > indexlog( "**** Becoming Daemon" ); > close STDIN; > close STDOUT; > exit if fork; > exit if fork; > } > 277d361 < my $kid; 280,289c364,365 < print "Unlinking $pidfile\n" if( $noise > 1 ); < unlink( $pidfile ) || die( "Can't unlink $pidfile" ); < if( defined $kid ) < { < print "Sending TERM signal to junior: $kid\n" if( $noise > 1 ); < kill 15, $kid; < } < < print "indexer snr exiting $$\n" if( $noise > 1 ); < exit; --- > indexlog( "*** TERM signal received" ) if( $p->{loglevel} > 1 ); > stopindexer( $p ); 293c369,370 < open( PID, ">$pidfile" ) || die "Can't open $pidfile for writing"; --- > > open( PID, ">>$p->{pidfile}" ) || die "Can't open $p->{pidfile} for writing: $!"; 303c380 < --- > indexlog( "** Indexer control process started with process ID: $$" ) if( $p->{loglevel} > 2 ); 306a384,385 > indexlog() if( $p->{loglevel} > 0 ); > indexlog( "*** Starting indexing" ) if( $p->{loglevel} > 1 ); 320a400 > indexlog( "*** Will not index '$arc_id': indexing disabled by config" ) if( $p->{loglevel} > 1 ); 325,329c405,408 < print "\n.$$.. - START.outer\n" if( $noise > 1); < $kid = fork(); < my $cmd = "/usr/bin/renice 8 $$"; < `$cmd`; < if( $kid == 0 ) --- > indexlog( "*** Staring index of archive '$arc_id'" ) if( $p->{loglevel} > 1 ); > > $p->{kid} = fork(); > if( $p->{kid} == 0 ) 330a410,412 > indexlog( "** Worker process started: $$" ) if( $p->{loglevel} > 2 ); > my $cmd = "/usr/bin/renice 8 $$"; > `$cmd`; 334c416 < print "indexer jnr exiting $$\n" if( $noise > 1 ); --- > indexlog( "** Worker process terminated: $$" ) if( $p->{loglevel} > 2 ); 339,340c421 < print "\n.$$.. - START.inner\n" if( $noise > 1); < $session = new EPrints::Session( 1 , $arc_id , $noise ); --- > $session = new EPrints::Session( 1 , $arc_id , $p->{noise} ); 345c426 < print "dataset: $arc_id .. $ds_id\n" if( $noise > 1); --- > indexlog( "** Indexing dataset '$ds_id' of '$arc_id'" ) if( $p->{loglevel} > 2 ); 349c430 < print STDERR "Error opening session: $arc_id\n"; --- > indexlog( "**** Error starting eprints session on '$arc_id'" ) if( $p->{loglevel} > 0 ); 351a433,448 > my $ilog; > my $elog; > if( $p->{loglevel} > 1 ) > { > $elog = eval 'sub { my( $txt ) = @_; indexlog( "*** ".$txt ); }'; > } > else > { > $elog = sub {;}; > } > > if( $p->{loglevel} > 4 ) > { > $ilog = \&indexlog; > } > 354c451,453 < $session->get_archive->get_dataset( $ds_id ) ); --- > $session->get_archive->get_dataset( $ds_id ), > $ilog, > $elog ); 355a455 > indexlog( "* Creating temporary index tables for '$ds_id' of '$arc_id'" ) if( $p->{loglevel} > 3 ); 356a457 > indexlog( "* Creating index for '$ds_id' of '$arc_id'" ) if( $p->{loglevel} > 3 ); 357a459 > indexlog( "* Installing index for '$ds_id' of '$arc_id'" ) if( $p->{loglevel} > 3 ); 358a461 > indexlog( "* Cleaning up after '$ds_id' of '$arc_id'" ) if( $p->{loglevel} > 3 ); 360a464 > indexlog( "* Done indexing dataset '$ds_id' of '$arc_id'" ) if( $p->{loglevel} > 3 ); 363a468 > indexlog( "** Sub process exiting: $$" ) if( $p->{loglevel} > 2 ); 365d469 < print "\n.$$.. - END.inner\n" if( $noise > 1 ); 369c473,475 < undef $kid; --- > undef $p->{kid}; > > indexlog( "*** Done indexing archive '$arc_id'" ) if( $p->{loglevel} > 1 ); 371d476 < print "\n.$$.. - END.outer\n" if( $noise > 1 ); 372a478,508 > indexlog( "*** Done indexing all archives" ) if( $p->{loglevel} > 1 ); > indexlog() if( $p->{loglevel} > 0 ); > > stopindexer($p) if( $p->{once} ); > > rolllogs( $p ); > } > > > #################################################################################### > > sub rolllogs > { > my( $p ) = @_; > > return if( $p->{loglevel} <= 0 ); > return if( $p->{rollcount} <= 0 ); > > indexlog( "** End of log. Closing and rolling." ) if( $p->{loglevel} > 2 ); > for( my $n = $p->{rollcount}; $n > 0; --$n ) > { > my $src = $p->{logfile}; > if( $n > 1 ) { $src.='.'.($n-1); } > next unless( -f $src ); > my $tgt = $p->{logfile}.'.'.$n; > rename( $src, $tgt ) || warn "Error renaming: $!"; > } > close STDERR; > open( STDERR, ">>$p->{logfile}" ) || warn "Error opening: $p->{logfile}: $!"; > select( STDERR ); > $| = 1; 378c514 < my( $pidfile, $noise ) = @_; --- > my( $p ) = @_; 380,381c516,517 < print "Reading $pidfile\n" if( $noise > 1 ); < open( PID, $pidfile ) || die( "Could not open $pidfile" ); --- > print "Reading $p->{pidfile}\n" if( $p->{noise} > 1 ); > open( PID, $p->{pidfile} ) || die( "Could not open $p->{pidfile}: $!" ); 394a531,562 > } > > sub indexlog > { > my( $txt ) = @_; > > if( !defined $txt ) > { > print STDERR "\n"; > return; > } > > print STDERR "[".localtime()."] ".$txt."\n"; > } > > sub stopindexer > { > my( $p ) = @_; > > indexlog( "** Control process $$ stopping..." ) if( $p->{loglevel} > 2 ); > indexlog( "* Unlinking $p->{pidfile}" ) if( $p->{loglevel} > 3 ); > unlink( $p->{pidfile} ) || die( "Can't unlink $p->{pidfile}" ); > if( defined $p->{kid} ) > { > indexlog( "* Sending TERM signal to worker process: $p->{kid}" ) if( $p->{loglevel} > 2 ); > kill 15, $p->{kid}; > } > > indexlog( "** Control process $$ stopped", 1 ) if( $p->{loglevel} > 2 ); > indexlog( "**** Indexer stopped" ) if( $p->{loglevel} > 0 ); > indexlog() if( $p->{loglevel} > 0 ); > exit; diff -r eprints-2.3.4/bin/rehash_documents eprints-2.3.6/bin/rehash_documents 93c93 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/reindex eprints-2.3.6/bin/reindex 105c105 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/send_subscriptions eprints-2.3.6/bin/send_subscriptions 99c99 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/bin/upgrade eprints-2.3.6/bin/upgrade 91c91 < EPrints Version: 2.3.4 --- > EPrints Version: 2.3.6 diff -r eprints-2.3.4/cgi/users/staff/edit_eprint eprints-2.3.6/cgi/users/staff/edit_eprint 327a328,329 > print STDERR "**". $eprint->get_dataset()->id()."**\n"; > print STDERR "**". join( '/', (@{$r1}, @{$r2}))."**\n"; diff -r eprints-2.3.4/defaultcfg/ArchiveConfig.pm eprints-2.3.6/defaultcfg/ArchiveConfig.pm 121,123d120 < # URL of document file hierarchy < $c->{documents_url} = $c->{base_url}."/archive"; < 135a133,137 > > # Use shorter URLs for records. > # Ie. use /23/ instead of /archive/00000023/ > $c->{use_short_urls} = 1; > diff -r eprints-2.3.4/install.pl.in eprints-2.3.6/install.pl.in 512c512 < print "Unable to install directory: $dir. $!\n"; --- > print "Unable to open package directory: $dir. $!\n"; diff -r eprints-2.3.4/perl_lib/EPrints/Config.pm eprints-2.3.6/perl_lib/EPrints/Config.pm 130c130 < $r->send_http_header; --- > EPrints::AnApache::send_http_header( $r ); diff -r eprints-2.3.4/perl_lib/EPrints/Database.pm eprints-2.3.6/perl_lib/EPrints/Database.pm 151,159c151 < # Connect to the database < $self->{dbh} = DBI->connect( < build_connection_string( < dbhost => $session->get_archive()->get_conf("dbhost"), < dbsock => $session->get_archive()->get_conf("dbsock"), < dbport => $session->get_archive()->get_conf("dbport"), < dbname => $session->get_archive()->get_conf("dbname") ), < $session->get_archive()->get_conf("dbuser"), < $session->get_archive()->get_conf("dbpass") ); --- > $self->connect; 161,166c153 < # { PrintError => 0, AutoCommit => 1 } ); < < if( !defined $self->{dbh} ) < { < return( undef ); < } --- > if( !defined $self->{dbh} ) { return( undef ); } 173,176d159 < if( $session->{noise} >= 4 ) < { < $self->{dbh}->trace( 2 ); < } 181a165,196 > ###################################################################### > =pod > > =item $foo = $db->connect > > Connects to the database. > > =cut > ###################################################################### > > sub connect > { > my( $self ) = @_; > > # Connect to the database > $self->{dbh} = DBI->connect( > build_connection_string( > dbhost => $self->{session}->get_archive()->get_conf("dbhost"), > dbsock => $self->{session}->get_archive()->get_conf("dbsock"), > dbport => $self->{session}->get_archive()->get_conf("dbport"), > dbname => $self->{session}->get_archive()->get_conf("dbname") ), > $self->{session}->get_archive()->get_conf("dbuser"), > $self->{session}->get_archive()->get_conf("dbpass") ); > > return unless defined $self->{dbh}; > > if( $self->{session}->{noise} >= 4 ) > { > $self->{dbh}->trace( 2 ); > } > } > 1835,1836c1850 < < if ( !$result ) --- > if( !$result ) 1838a1853,1872 > $self->{session}->get_archive()->log( "SQL ERROR (do): ".$self->{dbh}->errstr.' (#'.$self->{dbh}->err.')' ); > > return undef unless( $self->{dbh}->err == 2006 ); > > my $ccount = 0; > while( $ccount < 10 ) > { > ++$ccount; > sleep 3; > $self->{session}->get_archive()->log( "Attempting DB reconnect: $ccount" ); > $self->connect; > if( defined $self->{dbh} ) > { > $result = $self->{dbh}->do( $sql ); > return $result if( defined $result ); > $self->{session}->get_archive()->log( "SQL ERROR (do): ".$self->{dbh}->errstr ); > } > } > $self->{session}->get_archive()->log( "Giving up after 10 tries" ); > return undef; 1865,1866c1899,1900 < < if ( !$result ) --- > my $ccount = 0; > if( !$result ) 1868a1903,1922 > $self->{session}->get_archive()->log( "SQL ERROR (prepare): ".$self->{dbh}->errstr.' (#'.$self->{dbh}->err.')' ); > > return undef unless( $self->{dbh}->err == 2006 ); > > my $ccount = 0; > while( $ccount < 10 ) > { > ++$ccount; > sleep 3; > $self->{session}->get_archive()->log( "Attempting DB reconnect: $ccount" ); > $self->connect; > if( defined $self->{dbh} ) > { > $result = $self->{dbh}->prepare( $sql ); > return $result if( defined $result ); > $self->{session}->get_archive()->log( "SQL ERROR (prepare): ".$self->{dbh}->errstr ); > } > } > $self->{session}->get_archive()->log( "Giving up after 10 tries" ); > return undef; 1896,1897c1950 < < if ( !$result ) --- > while( !$result ) 1899a1953,1954 > $self->{session}->get_archive()->log( "SQL ERROR (execute): ".$self->{dbh}->errstr ); > return undef; diff -r eprints-2.3.4/perl_lib/EPrints/Document.pm eprints-2.3.6/perl_lib/EPrints/Document.pm 603c603,607 < my $basepath; --- > my $shorturl = $archive->get_conf( "use_short_urls" ); > $shorturl = 0 unless( defined $shorturl ); > > my $docpath = docid_to_path( $archive, $self->get_value( "docid" ) ); > 606c610 < $basepath = $archive->get_conf( "documents_url" ); --- > return $eprint->url_stem.$docpath.'/'; 608,614c612,617 < else < { < $basepath = $archive->get_conf( "secure_url" ); < } < return $basepath . "/" . < sprintf( "%08d", $eprint->get_value( "eprintid" )) . "/" . < docid_to_path( $archive, $self->get_value( "docid" ) ) . "/"; --- > > my $url = $archive->get_conf( "secure_url" ).'/'; > $url .= sprintf( "%08d", $eprint->get_value( "eprintid" ) ); > $url .= '/'.$docpath.'/'; > > return $url; diff -r eprints-2.3.4/perl_lib/EPrints/EPrint.pm eprints-2.3.6/perl_lib/EPrints/EPrint.pm 1264,1269c1264,1283 < return( < sprintf( < "%s/%08d/", < $self->{session}->get_archive()->get_conf( < "documents_url" ), < $self->{data}->{eprintid} ) ); --- > my $archive = $self->{session}->get_archive; > > my $shorturl = $archive->get_conf( "use_short_urls" ); > $shorturl = 0 unless( defined $shorturl ); > > my $url; > $url = $archive->get_conf( "base_url" ); > $url .= '/archive' unless( $shorturl ); > $url .= '/'; > if( $shorturl ) > { > $url .= $self->get_value( "eprintid" )+0; > } > else > { > $url .= sprintf( "%08d", $self->get_value( "eprintid" ) ); > } > $url .= '/'; > > return $url; diff -r eprints-2.3.4/perl_lib/EPrints/Index.pm eprints-2.3.6/perl_lib/EPrints/Index.pm 71c71 < my( $class, $session, $dataset ) = @_; --- > my( $class, $session, $dataset, $logfn, $elogfn ) = @_; 79c79,81 < grep_table_tmp => $dataset->get_sql_index_table_name."_grep_tmp" --- > grep_table_tmp => $dataset->get_sql_index_table_name."_grep_tmp", > logfn => $logfn, > elogfn => $elogfn 89a92,134 > =item $success = $index->log( $message ); > > undocumented > > =cut > ###################################################################### > > sub log > { > my( $self, $message ) = @_; > > if( defined $self->{logfn} ) > { > &{$self->{logfn}}( $message ); > } > } > > ###################################################################### > =pod > > =item $success = $index->logerror( $message ); > > undocumented > > =cut > ###################################################################### > > sub logerror > { > my( $self, $message ) = @_; > > if( defined $self->{elogfn} ) > { > &{$self->{elogfn}}( $message ); > return; > } > > $self->{session}->get_archive->log( $message ); > } > > ###################################################################### > =pod > 116a162 > $self->logerror( "Table $table still exists. Dropping it now." ); 157c203,204 < print STDERR "$self->{index_table_tmp} already exists. Indexer exited abnormally or still running?\nDropping table: $self->{index_table_tmp}\n"; --- > $self->logerror( "$self->{index_table_tmp} already exists. Indexer exited abnormally or still running?" ); > $self->log( "Dropping table: $self->{index_table_tmp}" ); 162a210 > $self->log( "Creating table: $self->{index_table_tmp}" ); 183c231,232 < print STDERR "$self->{grep_table_tmp} already exists. Indexer exited abnormally or still running?\nDropping table: $self->{grep_table_tmp}\n"; --- > $self->logerror( "$self->{grep_table_tmp} already exists. Indexer exited abnormally or still running?" ); > $self->log( "Dropping table: $self->{grep_table_tmp}" ); 189a239 > $self->log( "Creating table: $self->{grep_table_tmp}" ); 220c270,271 < print STDERR "$order_table_tmp already exists. Indexer exited abnormally or still running?\nDropping table: $order_table_tmp\n"; --- > $self->logerror( "$order_table_tmp already exists. Indexer exited abnormally or still running?" ); > $self->log( "Dropping table: $order_table_tmp" ); 225a277 > $self->log( "Creating table: $order_table_tmp" ); 273a326 > $info->{indexer}->log( "Indexing: ".$dataset->get_archive->get_id.'.'.$dataset->id.".".$id ); 431a485 > $self->log( "Installing table: ".$self->{index_table_tmp} ); 438c492 < $self->{session}->get_archive->log( "Table does not exist to install: ".$self->{index_table_tmp} ); --- > $self->logerror( "Table does not exist to install: ".$self->{index_table_tmp} ); 443a498 > $self->log( "Installing table: ".$self->{grep_table_tmp} ); 450c505 < $self->{session}->get_archive->log( "Table does not exist to install: ".$self->{grep_table_tmp} ); --- > $self->logerror( "Table does not exist to install: ".$self->{grep_table_tmp} ); 461c516 < $self->{session}->get_archive->log( "Table does not exist to install: ".$order_table_tmp ); --- > $self->logerror( "Table does not exist to install: ".$order_table_tmp ); 464a520 > $self->log( "Installing table: ".$order_table_tmp ); 474c530 < $self->{session}->get_archive->log( "EPrints::Index::install failed to open\n$statusfile\nfor writing." ); --- > $self->errorlog( "EPrints::Index::install failed to open $statusfile for writing." ); 651,652c707,708 < # This map is used to convert ASCII characters over < # 127 to characters below 127, in the word index. --- > # This map is used to convert Unicode characters > # to ASCII characters below 127, in the word index. 657a714,715 > > # Basic latin1 mappings 705c763,770 < latin1("") => "y", latin1("'") => "" }; --- > latin1("") => "y", latin1("'") => "", > > # Hungarian characters. > '' => "o", > 'Ő' => "o", > 'ű' => "u", > 'Ű' => "u", > }; diff -r eprints-2.3.4/perl_lib/EPrints/MetaField/Fulltext.pm eprints-2.3.6/perl_lib/EPrints/MetaField/Fulltext.pm 47d46 < 52,53c51 < my $text = $doc->get_text; < push @{$r}, $text; --- > push @{$r}, "_FULLTEXT_:".$doc->get_id; 57a56,115 > sub get_index_codes_basic > { > my( $self, $session, $value ) = @_; > > if( $value !~ s/^_FULLTEXT_:// ) > { > return $self->SUPER::get_index_codes_basic( $session, $value ); > } > my $doc = EPrints::Document->new( $session, $value ); > > > my $eprint = $doc->get_eprint; > return( [], [], [] ) unless( defined $eprint ); > > my $words_file = $eprint->local_path."/". $doc->get_value( "docid" ).".words"; > my $indexcodes_file = $eprint->local_path."/". $doc->get_value( "docid" ).".indexcodes"; > my @s1 = stat( $words_file ); > my @s2 = stat( $indexcodes_file ); > > if( !defined $s1[9] ) > { > # no words file! > return( [], [], [] ); > } > > if( defined $s2[9] && $s2[9] > $s1[9] ) > { > my $codes = []; > unless( open( CODELOG, $indexcodes_file ) ) > { > $session->get_archive->log( "Failed to open $indexcodes_file: $!" ); > } > else > { > foreach( ) { chomp; push @$codes, $_; } > close CODELOG; > } > return( $codes, [], [] ); > } > > $value = $doc->get_text; > my( $codes, $badwords ) = ( [], [] ); > if( EPrints::Utils::is_set( $value ) ) > { > ( $codes, $badwords ) = EPrints::MetaField::Text::_extract_words( $session, $value ); > } > > unless( open( CODELOG, ">".$indexcodes_file ) ) > { > $session->get_archive->log( "Failed to write to $indexcodes_file: $!" ); > } > else > { > print CODELOG join( "\n", @$codes ); > close CODELOG; > } > > # does not return badwords > return( $codes, [], [] ); > } diff -r eprints-2.3.4/perl_lib/EPrints/MetaField/Set.pm eprints-2.3.6/perl_lib/EPrints/MetaField/Set.pm 244c244 < value=>$searchfield->get_merge, --- > default=>$searchfield->get_merge, diff -r eprints-2.3.4/perl_lib/EPrints/Rewrite.pm eprints-2.3.6/perl_lib/EPrints/Rewrite.pm 44c44,46 < if( $uri =~ m#^/archive/([0-9]{1,7})($|/[^0-9].*)# ) --- > > # shorturl does not (yet) effect secure docs. > if( $uri =~ s#^/secure/([0-9]+)([0-9][0-9])([0-9][0-9])([0-9][0-9])#/secure/$1/$2/$3/$4# ) 45a48,59 > $r->filename( $archive->get_conf( "htdocs_path" )."/".$uri ); > return OK; > } > > > my $shorturl = $archive->get_conf( "use_short_urls" ); > $shorturl = 0 unless( defined $shorturl ); > > #$uri =~ s#^/archive/([0-9]+)([0-9][0-9])([0-9][0-9])([0-9][0-9])#/archive/$1/$2/$3/$4#; > if( $uri =~ m#^/archive/([0-9]+)(.*)$# ) > { > # is a long record url 48c62,73 < if( $tail eq "" ) --- > my $redir =0; > if( $tail eq "" ) { $tail = "/"; $redir=1 } > > if( $shorturl ) > { > # redirect to short form > return redir( $r, sprintf( "%s/%d%s",$urlpath, $n, $tail ) ); > } > > my $s8 = sprintf('%08d',$n); > $s8 =~ m/(..)(..)(..)(..)/; > if( length $n < 8 || $redir) 50c75,76 < $tail = "/"; --- > # not enough zeros, redirect to correct version > return redir( $r, sprintf( "%s/archive/%08d%s",$urlpath, $n, $tail ) ); 52,56c78 < my $url = sprintf( "%s/archive/%08d%s",$urlpath, $n, $tail ); < $r->status_line( "302 Close but no Cigar" ); < EPrints::AnApache::header_out( $r, "Location", $url ); < $r->send_http_header; < return DONE; --- > $uri = "/archive/$1/$2/$3/$4$tail"; 59c81,82 < if( $uri =~ s#^/secure/([0-9]+)([0-9][0-9])([0-9][0-9])([0-9][0-9])#/secure/$1/$2/$3/$4# ) --- > > if( $uri =~ m#^/([0-9]+)(.*)$# ) 61,63c84,93 < $r->filename( $archive->get_conf( "htdocs_path" )."/".$uri ); < return OK; < } --- > # is a shorturl record url > my $n = $1; > my $tail = $2; > my $redir = 0; > if( $tail eq "" ) { $tail = "/"; $redir = 1; } > if( !$shorturl ) > { > # redir to long form > return redir( $r, sprintf( "%s/archive/%08d%s",$urlpath, $n, $tail )); > } 65c95,103 < $uri =~ s#^/archive/([0-9]+)([0-9][0-9])([0-9][0-9])([0-9][0-9])#/archive/$1/$2/$3/$4#; --- > if( ($n + 0) ne $n || $redir) > { > # leading zeros > return redir( $r, sprintf( "%s/%d%s",$urlpath, $n, $tail ) ); > } > my $s8 = sprintf('%08d',$n); > $s8 =~ m/(..)(..)(..)(..)/; > $uri = "/archive/$1/$2/$3/$4$tail"; > } 80a119,127 > sub redir > { > my( $r, $url ) = @_; > > $r->status_line( "302 Close but no Cigar" ); > EPrints::AnApache::header_out( $r, "Location", $url ); > $r->send_http_header; > return DONE; > } diff -r eprints-2.3.4/perl_lib/EPrints/SearchExpression.pm eprints-2.3.6/perl_lib/EPrints/SearchExpression.pm 1453c1453 < my $conditions = $self->get_conditions; --- > #my $conditions = $self->get_conditions; diff -r eprints-2.3.4/perl_lib/EPrints/Session.pm eprints-2.3.6/perl_lib/EPrints/Session.pm 137a138 > $mode = 0 unless defined( $mode ); 1246c1247,1248 < next if( $_ =~ m/^_/ ); --- > next if( $button_id eq '_class' ); > next if( $button_id eq '_order' ); 1513c1515 < foreach( %INPUT_FORM_DEFAULTS ) --- > foreach( keys %INPUT_FORM_DEFAULTS ) 1846c1848 < print EPrints::XML::to_string( $self->{page} ); --- > print EPrints::XML::to_string( $self->{page}, undef, 1 ); diff -r eprints-2.3.4/perl_lib/EPrints/XML.pm eprints-2.3.6/perl_lib/EPrints/XML.pm 434c434 < =item $string = EPrints::XML::to_string( $node, [$enc] ) --- > =item $string = EPrints::XML::to_string( $node, [$enc], [$noxmlns] ) 439a440,442 > If $stripxmlns is true then all xmlns attributes are removed. Handy > for making legal XHTML. > 450c453 < my( $node, $enc ) = @_; --- > my( $node, $enc, $noxmlns ) = @_; 470c473 < next if( $name =~ m/^xmlns/ ); --- > next if( $noxmlns && $name =~ m/^xmlns/ ); 501c504 < push @n, to_string( $kid ); --- > push @n, to_string( $kid, $enc, $noxmlns ); 510c513 < push @n, to_string( $kid ); --- > push @n, to_string( $kid, $enc, $noxmlns ); 517c520 < #push @n, $docType->toString, "\n";, to_string( $elem ); --- > #push @n, $docType->toString, "\n";, to_string( $elem , $enc, $noxmlns); 682c685 < print XMLFILE EPrints::XML::to_string( $node, "utf-8" ); --- > print XMLFILE EPrints::XML::to_string( $node, "utf-8", 1 );