Fix to "rn" for 2.10.3 & XREF

Gene Spafford spaf at gatech.CSNET
Fri Mar 14 08:43:16 AEST 1986


#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	README
#	Configure.patch
#	bits.c.patch
# This archive created: Thu Mar 13 17:40:54 1986
# By:	Gene Spafford (The Clouds Project, School of ICS, Georgia Tech)
export PATH; PATH=/bin:$PATH
echo shar: extracting "'README'" '(1117 characters)'
if test -f 'README'
then
	echo shar: will not over-write existing file "'README'"
else
sed 's/^XX//' << \SHAR_EOF > 'README'
XXThe following two files contain patches to fix "rn" to work with news
XX2.10.3.  That version of news no longer supports the "Relay-version"
XXand "Posting-version" headers in articles, and "rn" uses those header
XXlines to determine system name when checking the "Xref" line in
XXarticles.
XX
XXThese patches were developed by Peter Wan (gatech!wan) for version 4.3
XX"rn" at patchlevel 27.  The version of news this works with is 2.10.3,
XXthe 1/17/86 release.  We have applied these "rn" patches on systems
XXrunning earlier versions of 2.10.3, and 2.10.2 news, and "rn" continues
XXto work properly, so you can (most probably) apply these to your
XXcurrent version of "rn" no matter what the current level of news
XXsoftware might be.
XX
XXThe change to Configure allows it to identify if you are running 2.10.3
XXnews, and the changes to bits.c allow it to determine the system name
XXto compare against the "Xref" line based on the news version.
XX
XXAs usual, there is no warranty expressed or implied that this software
XXis correct or in any way suitable for any use to which you may wish to
XXput it.  Use it in good cheer.
XX
XXGene Spafford
XX3/12/86
SHAR_EOF
fi # end of overwriting check
echo shar: extracting "'Configure.patch'" '(3078 characters)'
if test -f 'Configure.patch'
then
	echo shar: will not over-write existing file "'Configure.patch'"
else
sed 's/^XX//' << \SHAR_EOF > 'Configure.patch'
XX
XX*** Configure	Thu Feb 20 02:48:59 1986
XX--- Configure.new	Thu Feb 20 02:46:23 1986
XX***************
XX*** 113,118
XX  douname=''
XX  phostname=''
XX  hostcmd=''
XX  CONFIG=''
XX  
XX  echo "Beginning of configuration questions for rn kit."
XX
XX--- 113,119 -----
XX  douname=''
XX  phostname=''
XX  hostcmd=''
XX+ norelay=''
XX  CONFIG=''
XX  
XX  echo "Beginning of configuration questions for rn kit."
XX***************
XX*** 1349,1355
XX      fi
XX  done
XX  
XX! : check for 2.10.2
XX  echo " "
XX  if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
XX      echo "Looks like you are running at least 2.10.2 news."
XX
XX--- 1350,1356 -----
XX      fi
XX  done
XX  
XX! : check for 2.10.2 and above
XX  echo " "
XX  if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
XX      case "$norelay" in
XX***************
XX*** 1352,1357
XX  : check for 2.10.2
XX  echo " "
XX  if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
XX      echo "Looks like you are running at least 2.10.2 news."
XX      mininact=define
XX  else
XX
XX--- 1353,1370 -----
XX  : check for 2.10.2 and above
XX  echo " "
XX  if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
XX+     case "$norelay" in
XX+     undef) dflt="n";;
XX+     *)     dflt="y";;
XX+     esac
XX+     $echo $n "Are you running 2.10.3 or above? [${dflt}] $c"
XX+     . myread
XX+     case "$ans" in
XX+     '') ans=$dflt;;
XX+     esac
XX+     case "$ans" in
XX+     n*)
XX+ 	norelay='undef'
XX  	echo "Looks like you are running at least 2.10.2 news."
XX  	;;
XX      *)  norelay='define' ;;
XX***************
XX*** 1353,1358
XX  echo " "
XX  if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
XX      echo "Looks like you are running at least 2.10.2 news."
XX      mininact=define
XX  else
XX      echo "It doesn't look like you are running 2.10.2 news yet.  Are you planning"
XX
XX--- 1366,1374 -----
XX      n*)
XX  	norelay='undef'
XX  	echo "Looks like you are running at least 2.10.2 news."
XX+ 	;;
XX+     *)  norelay='define' ;;
XX+     esac
XX      mininact=define
XX  else
XX      echo "It doesn't look like you are running 2.10.2 news yet.  Are you planning"
XX***************
XX*** 1362,1367
XX      n*) mininact=undef ;;
XX      *)  mininact=define ;;
XX      esac
XX  fi
XX  
XX  
XX
XX--- 1378,1384 -----
XX      n*) mininact=undef ;;
XX      *)  mininact=define ;;
XX      esac
XX+     norelay='undef'
XX  fi
XX  
XX  
XX***************
XX*** 1818,1823
XX  douname='$douname'
XX  phostname='$phostname'
XX  hostcmd='$hostcmd'
XX  CONFIG=true
XX  EOT
XX  
XX
XX--- 1835,1841 -----
XX  douname='$douname'
XX  phostname='$phostname'
XX  hostcmd='$hostcmd'
XX+ norelay='$norelay'
XX  CONFIG=true
XX  EOT
XX  
XX***************
XX*** 1904,1909
XX  #$gethostname	GETHOSTNAME	/* do we have a gethostname function? */
XX  #$douname	DOUNAME		/* do we have a uname function? */
XX  #$phostname	PHOSTNAME "$hostcmd"	/* how to get host name with popen */
XX  EOT
XX  
XX  CONFIG=true
XX
XX--- 1922,1928 -----
XX  #$gethostname	GETHOSTNAME	/* do we have a gethostname function? */
XX  #$douname	DOUNAME		/* do we have a uname function? */
XX  #$phostname	PHOSTNAME "$hostcmd"	/* how to get host name with popen */
XX+ #$norelay	NORELAY		/* 2.10.3 doesn't have Relay-Version line */
XX  EOT
XX  
XX  CONFIG=true
XX
SHAR_EOF
fi # end of overwriting check
echo shar: extracting "'bits.c.patch'" '(2199 characters)'
if test -f 'bits.c.patch'
then
	echo shar: will not over-write existing file "'bits.c.patch'"
else
sed 's/^XX//' << \SHAR_EOF > 'bits.c.patch'
XX
XX*** bits.c	Thu Feb 20 02:49:00 1986
XX--- bits.c.new	Wed Feb 19 21:23:36 1986
XX***************
XX*** 391,396
XX  
XX  	    if (inews_site != Nullch)
XX  		free(inews_site);
XX  	    rver_buf = fetchlines(artnum,RVER_LINE);
XX  	    if ((t = instr(rver_buf,"; site ")) == Nullch)
XX  		inews_site = savestr(nullstr);
XX
XX--- 391,397 -----
XX  
XX  	    if (inews_site != Nullch)
XX  		free(inews_site);
XX+ #ifndef NORELAY
XX  	    rver_buf = fetchlines(artnum,RVER_LINE);
XX  	    if ((t = instr(rver_buf,"; site ")) == Nullch)
XX  #else NORELAY
XX***************
XX*** 393,398
XX  		free(inews_site);
XX  	    rver_buf = fetchlines(artnum,RVER_LINE);
XX  	    if ((t = instr(rver_buf,"; site ")) == Nullch)
XX  		inews_site = savestr(nullstr);
XX  	    else {
XX  		char new_site[128];
XX
XX--- 394,411 -----
XX  #ifndef NORELAY
XX  	    rver_buf = fetchlines(artnum,RVER_LINE);
XX  	    if ((t = instr(rver_buf,"; site ")) == Nullch)
XX+ #else NORELAY
XX+ 
XX+ 	    /* In version 2.10.3 of news or afterwards, the Relay-Version
XX+ 	     * and Posting-Version header lines have been removed.  For
XX+ 	     * the code below to work as intended, I have modified it to
XX+ 	     * extract the first component of the Path header line.  This
XX+ 	     * should give the same effect as did the old code with respect
XX+ 	     * to the use of the Relay-Version site name.
XX+ 	     */
XX+ 	    rver_buf = fetchlines(artnum,PATH_LINE);
XX+ 	    if ((t = instr(rver_buf,"!")) == Nullch)
XX+ #endif NORELAY
XX  		inews_site = savestr(nullstr);
XX  	    else {
XX  		char new_site[128];
XX***************
XX*** 397,402
XX  	    else {
XX  		char new_site[128];
XX  
XX  		cpytill(new_site,t + 7,'.');
XX  		inews_site = savestr(new_site);
XX  	    }
XX
XX--- 410,416 -----
XX  	    else {
XX  		char new_site[128];
XX  
XX+ #ifndef NORELAY
XX  		cpytill(new_site,t + 7,'.');
XX  #else NORELAY
XX  		cpytill(new_site,rver_buf,'!');
XX***************
XX*** 398,403
XX  		char new_site[128];
XX  
XX  		cpytill(new_site,t + 7,'.');
XX  		inews_site = savestr(new_site);
XX  	    }
XX  	    if (strNE(tmpbuf,inews_site)) {
XX
XX--- 412,420 -----
XX  
XX  #ifndef NORELAY
XX  		cpytill(new_site,t + 7,'.');
XX+ #else NORELAY
XX+ 		cpytill(new_site,rver_buf,'!');
XX+ #endif NORELAY
XX  		inews_site = savestr(new_site);
XX  	    }
XX  	    if (strNE(tmpbuf,inews_site)) {
XX
SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
Gene "writing furiously" Spafford
The Clouds Project, School of ICS, Georgia Tech, Atlanta GA 30332-0280
CSNet:	Spaf @ GATech		ARPA:	Spaf%GATech.CSNet @ Relay.CS.NET
uucp:	...!{akgua,decvax,hplabs,ihnp4,linus,seismo,ulysses}!gatech!spaf



More information about the Comp.sources.bugs mailing list