Index: harvest/components/broker/standard/WWW/nph-search.in
diff -c harvest/components/broker/standard/WWW/nph-search.in:2.6 harvest/components/broker/standard/WWW/nph-search.in:2.7
*** harvest/components/broker/standard/WWW/nph-search.in:2.6	Fri Oct  3 11:08:42 1997
--- harvest/components/broker/standard/WWW/nph-search.in	Sun Oct 12 16:08:09 1997
***************
*** 8,14 ****
  #  $BQLOG = "/usr/local/etc/httpd/logs/BrokerQuery.log";
  $BQLOG = "/dev/null";
  
! $rcsid = 'nph-search.in,v 2.6 1997/10/03 15:08:42 sxw Exp';
  #######################################################################
  #
  #  nph-search - Customizable WWW Interface to the Harvest Broker
--- 8,14 ----
  #  $BQLOG = "/usr/local/etc/httpd/logs/BrokerQuery.log";
  $BQLOG = "/dev/null";
  
! $rcsid = 'nph-search.in,v 2.7 1997/10/12 20:08:09 sxw Exp';
  #######################################################################
  #
  #  nph-search - Customizable WWW Interface to the Harvest Broker
***************
*** 238,245 ****
  #
  $html_query = &html_escape ($query);
  print &expand ($CFG{'ResultHeader'});
! push @first_page, &expand ($CFG{'ResultHeader'}) if $perpage && !
! $current_page;
  $connected = 0;
  
  while ($#hostport > $[) {
--- 238,245 ----
  #
  $html_query = &html_escape ($query);
  print &expand ($CFG{'ResultHeader'});
! push(@first_page, &expand ($CFG{'ResultHeader'})) 
!  	if $perpage && !$current_page;
  $connected = 0;
  
  while ($#hostport > $[) {
***************
*** 465,471 ****
                           || ($new_line =~ /^111 - (.*)$/o))) {
                          $curobj="$new_line\n";
                          print &expand ($CFG{'ResultSetEnd'});
!                         push @first_page, &expand ($CFG{'ResultSetEnd'})
                              if $perpage && ! $current_page;
                          $msg = $1;
                          if ($msg =~ /PARSE ERROR/o) {
--- 465,471 ----
                           || ($new_line =~ /^111 - (.*)$/o))) {
                          $curobj="$new_line\n";
                          print &expand ($CFG{'ResultSetEnd'});
!                         push(@first_page, &expand ($CFG{'ResultSetEnd'}))
                              if $perpage && ! $current_page;
                          $msg = $1;
                          if ($msg =~ /PARSE ERROR/o) {
***************
*** 555,561 ****
                  # 111 - Error Message that ends Broker Results
                  if (/^103 - (.*)$/o || /^111 - (.*)$/o) {
                      print &expand ($CFG{'ResultSetEnd'});
!                     push @first_page, &expand ($CFG{'ResultSetEnd'})
                          if $perpage && ! $current_page;
                      $msg = $1;
                      if ($msg =~ /PARSE ERROR/o) {
--- 555,561 ----
                  # 111 - Error Message that ends Broker Results
                  if (/^103 - (.*)$/o || /^111 - (.*)$/o) {
                      print &expand ($CFG{'ResultSetEnd'});
!                     push(@first_page, &expand ($CFG{'ResultSetEnd'}))
                          if $perpage && ! $current_page;
                      $msg = $1;
                      if ($msg =~ /PARSE ERROR/o) {
***************
*** 627,633 ****
                          $attributes .= &expand($CFG{'FormatAttribute'});
                      }
                      print &expand ($CFG{'PrintObject'});
!                     push @first_page, &expand ($CFG{'PrintObject'})
                        if $perpage && ! $current_page;
                      &N_at_a_time(1)
                        if $perpage && 0==$nobjects%$perpage && $nobjects>0;
--- 627,633 ----
                          $attributes .= &expand($CFG{'FormatAttribute'});
                      }
                      print &expand ($CFG{'PrintObject'});
!                     push(@first_page, &expand ($CFG{'PrintObject'}))
                        if $perpage && ! $current_page;
                      &N_at_a_time(1)
                        if $perpage && 0==$nobjects%$perpage && $nobjects>0;
***************
*** 1041,1049 ****
  
  # translate SGML entities
  # produced from
! # perl -ne 'if (/^ *<.ENTITY *([\S]*) *CDATA *"&#([\d]+);".*>/) { if ($2 <
! 0x100) {printf "s/&$1;/\\x%x/g;\n", $2;} else {printf
! "s/&$1;/\\\\#$2/g;\n";}}'
  
  sub entities {
      $_ = $_[0];
--- 1041,1049 ----
  
  # translate SGML entities
  # produced from
! # perl -ne 'if (/^ *<.ENTITY *([\S]*) *CDATA *"&#([\d]+);".*>/) 
! #              { if ($2 <0x100) {printf "s/&$1;/\\x%x/g;\n", $2;} 
! # 		 else {printf "s/&$1;/\\\\#$2/g;\n";}}'
  
  sub entities {
      $_ = $_[0];
***************
*** 1329,1335 ****
  #
  # $tmp_dir
  # This is the location where temporary files are kept. This directory needs a
! # permissive access mode, 'chmod 777', so that the 'nobody' user (or whatever
  # user httpd uses) can write and delete files there.  It is a fatal error if
  # this directory does not exist, or cannot be written in.
  #
--- 1329,1335 ----
  #
  # $tmp_dir
  # This is the location where temporary files are kept. This directory needs a
! # permissive access mode, so that the 'nobody' user (or whatever
  # user httpd uses) can write and delete files there.  It is a fatal error if
  # this directory does not exist, or cannot be written in.
  #
***************
*** 1342,1357 ****
  # points to $tmp_dir.
  
  	###### configure these locally! #######
! 	my $expire  = 3;	# expiration interval, in hours
! 	my $tmp_dir = "$ENV{HARVEST_HOME}/tmp";	# dir for temp files;
! 'chmod 777'!
! 	my $tmp_www = "tmp";					# URL path
! pointing to $tmp_dir
  	######    end configuration     #######
  
  	local($more) = @_;
! 	my($previous_page, $next_page);
! 	my $tmp_prefix = "$^T-${$}";	# prefix for temporary files
  
  	# if this is the last page of results, remove old temporary files
  	# (if $expire=3, then 3/24 sets a 3 hour expiration cycle)
--- 1342,1355 ----
  # points to $tmp_dir.
  
  	###### configure these locally! #######
! 	local($expire)  = 3;	# expiration interval, in hours
! 	local($tmp_dir) = "$ENV{HARVEST_HOME}/tmp";	# dir for temp files;
! 	local($tmp_www) = "Harvest/tmp";      # URL path pointing to $tmp_dir
  	######    end configuration     #######
  
  	local($more) = @_;
! 	local($previous_page, $next_page);
! 	local($tmp_prefix) = "$^T-${$}";	# prefix for temporary files
  
  	# if this is the last page of results, remove old temporary files
  	# (if $expire=3, then 3/24 sets a 3 hour expiration cycle)
***************
*** 1366,1396 ****
  	if (! $current_page) {
  		$current_page = 1;
  		open(TEMP,">$tmp_dir/$tmp_prefix-1.html") ||
! 			&fatal("<b>Error: cannot write temporary files at
! '$tmp_dir'!</b>");
!         print TEMP "<html>\n";
  		print TEMP &expand ($CFG{'ResultHeader'});
  		print TEMP @first_page;
!         print TEMP &expand ($CFG{'ResultSetEnd'});
  		print TEMP "<p>\n<center>";
! 		print TEMP qq{[<a
! href="/$tmp_www/$tmp_prefix-2.html">Next</a>]};
! 	    print TEMP qq{[<a href="$hp_url">New Search</a>]} if $hp_url ne
! 'UNKNOWN';
  		print TEMP "<p>\n</center>";
  		print TEMP "</body></html>\n";
  		undef @first_page;
  	}
  
  	# finish off current page
!     print &expand ($CFG{'ResultSetEnd'}) if $more;
  	$previous_page = $current_page - 1; $next_page = $current_page + 1;
  	print "<p>\n<center>";
! 	print qq{[<a
! href="/$tmp_www/$tmp_prefix-$previous_page.html">Previous</a>]}
  		if $previous_page > 0;
! 	print qq{[<a
! href="/$tmp_www/$tmp_prefix-$next_page.html">Next</a>]} if $more;
  	print qq{[<a href="$hp_url">New Search</a>]} if $hp_url ne 'UNKNOWN';
  	print "</center>\n";
  	return unless $more; # stop here if no more results!
--- 1364,1391 ----
  	if (! $current_page) {
  		$current_page = 1;
  		open(TEMP,">$tmp_dir/$tmp_prefix-1.html") ||
! 			&fatal("<b>Error: cannot write temporary files at '$tmp_dir'!</b>");
! 	        print TEMP "<html>\n";
  		print TEMP &expand ($CFG{'ResultHeader'});
  		print TEMP @first_page;
!         	print TEMP &expand ($CFG{'ResultSetEnd'});
  		print TEMP "<p>\n<center>";
! 		print TEMP qq{[<a href="/$tmp_www/$tmp_prefix-2.html">Next</a>]};
! 	        print TEMP qq{[<a href="$hp_url">New Search</a>]} 
! 			if $hp_url ne 'UNKNOWN';
  		print TEMP "<p>\n</center>";
  		print TEMP "</body></html>\n";
  		undef @first_page;
  	}
  
  	# finish off current page
!         print &expand ($CFG{'ResultSetEnd'}) if $more;
  	$previous_page = $current_page - 1; $next_page = $current_page + 1;
  	print "<p>\n<center>";
! 	print qq{[<a href="/$tmp_www/$tmp_prefix-$previous_page.html">Previous</a>]}
  		if $previous_page > 0;
! 	print qq{[<a href="/$tmp_www/$tmp_prefix-$next_page.html">Next</a>]} 
! 		if $more;
  	print qq{[<a href="$hp_url">New Search</a>]} if $hp_url ne 'UNKNOWN';
  	print "</center>\n";
  	return unless $more; # stop here if no more results!
***************
*** 1400,1411 ****
  	$current_page++;
  	close(TEMP);
  	open(TEMP,">$tmp_dir/$tmp_prefix-$current_page.html") ||
! 		&fatal("<b>Error: cannot write temporary files at
! '$tmp_dir'!</b>");
  	select(TEMP);
  
  	# print beginning of next page
  	print "<html>\n";
  	print &expand ($CFG{'ResultHeader'});
!     print &expand ($CFG{'ResultSetBegin'});
  }
--- 1395,1405 ----
  	$current_page++;
  	close(TEMP);
  	open(TEMP,">$tmp_dir/$tmp_prefix-$current_page.html") ||
! 		&fatal("<b>Error: cannot write temporary files at '$tmp_dir'!</b>");
  	select(TEMP);
  
  	# print beginning of next page
  	print "<html>\n";
  	print &expand ($CFG{'ResultHeader'});
!         print &expand ($CFG{'ResultSetBegin'});
  }

Index: harvest/src/Makefile.in
diff -c harvest/src/Makefile.in:2.1 harvest/src/Makefile.in:2.2
*** harvest/src/Makefile.in:2.1	Thu Sep 11 12:14:54 1997
--- harvest/src/Makefile.in	Sun Oct 12 16:04:03 1997
***************
*** 1,7 ****
  #
  #  Makefile for the Harvest source tree
  # 
! #  Makefile.in,v 2.1 1997/09/11 16:14:54 sxw Exp
  #
  #  --------------------------------------------------------------------
  
--- 1,7 ----
  #
  #  Makefile for the Harvest source tree
  # 
! #  Makefile.in,v 2.2 1997/10/12 20:04:03 sxw Exp
  #
  #  --------------------------------------------------------------------
  
***************
*** 24,30 ****
  all: do-all
  clean: do-clean
  distclean: do-distclean this-distclean
! install: do-install this-install
  
  this-install: install-mkdir
  	/bin/sh make-symlinks.sh "$(prefix)"
--- 24,30 ----
  all: do-all
  clean: do-clean
  distclean: do-distclean this-distclean
! install: this-install do-install 
  
  this-install: install-mkdir
  	/bin/sh make-symlinks.sh "$(prefix)"
