[news.software.b] news pl 17 / bad newsgroups problem

murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) (04/26/89)

B News 2.11 Patchlevel 17

Has anyone come up with a patch that prevents rnews from dumping its
bad articles in /usr/spool/news/.bad when it already places them
in junk?

Right now, if inews -U spawns rnews, which returns "256" when it cannot
find a valid newsgroup, it places the article in junk.  Since rnews
returns with a non-zero exit-status, inews -U also places the bad news
batch in /usr/spool/news/.bad!

I'll fix it, but I'd rather not re-invent the wheel.

... Erik
-- 
Erik Murrey
Lehigh University
murrey@csee.Lehigh.EDU
erik@mpx.com

chip@vector.Dallas.TX.US (Chip Rosenthal) (04/29/89)

In article <558@lehi3b15.csee.Lehigh.EDU> murrey@csee.Lehigh.EDU (Erik Murrey) writes:
>if inews -U spawns rnews, which returns "256" when it cannot
>find a valid newsgroup, it places the article in junk.  Since rnews
>returns with a non-zero exit-status, inews -U also places the bad news
>batch in /usr/spool/news/.bad!

Yeah.  My hack for this follows.

Index: inews.c
*** inews.c.ORIG	Fri Mar 24 00:17:14 1989
--- inews.c	Fri Apr 28 14:39:06 1989
***************
*** 952,955
  	struct tm *tm, *gmtime();
  	int is_invalid = FALSE;
  	int exitcode = 0;
  	long now;

--- 952,956 -----
  	struct tm *tm, *gmtime();
  	int is_invalid = FALSE;
+ 	int junked = FALSE;
  	int exitcode = 0;
  	long now;
***************
*** 991,995
  		logerr("%s: No valid newsgroups found, moved to junk",
  			header.nbuf);
! 		if (localize("junk"))
  			savehist(histline);
  		exitcode = 1;

--- 992,996 -----
  		logerr("%s: No valid newsgroups found, moved to junk",
  			header.nbuf);
! 		if (localize("junk")) {
  			savehist(histline);
  			junked = TRUE;
***************
*** 993,996
  		if (localize("junk"))
  			savehist(histline);
  		exitcode = 1;
  		goto writeout;

--- 994,999 -----
  		if (localize("junk")) {
  			savehist(histline);
+ 			junked = TRUE;
+ 		}
  		exitcode = 1;
  		goto writeout;
***************
*** 1000,1004
  	if (STRNCMP(header.title, "Re: Orphaned Response", 21) == 0) {
  		logerr("Orphaned Response, moved to junk");
! 		if (localize("junk"))
  			savehist(histline);
  		exitcode = 1;

--- 1003,1007 -----
  	if (STRNCMP(header.title, "Re: Orphaned Response", 21) == 0) {
  		logerr("Orphaned Response, moved to junk");
! 		if (localize("junk")) {
  			savehist(histline);
  			junked = TRUE;
***************
*** 1002,1005
  		if (localize("junk"))
  			savehist(histline);
  		exitcode = 1;
  		goto writeout;

--- 1005,1010 -----
  		if (localize("junk")) {
  			savehist(histline);
+ 			junked = TRUE;
+ 		}
  		exitcode = 1;
  		goto writeout;
***************
*** 1009,1013
  	if (time((time_t *)0) > (cgtdate(header.subdate) + HISTEXP) ){
  		logerr("Article too old, moved to junk");
! 		if (localize("junk"))
  			savehist(histline);
  		exitcode = 1;

--- 1014,1018 -----
  	if (time((time_t *)0) > (cgtdate(header.subdate) + HISTEXP) ){
  		logerr("Article too old, moved to junk");
! 		if (localize("junk")) {
  			savehist(histline);
  			junked = TRUE;
***************
*** 1011,1014
  		if (localize("junk"))
  			savehist(histline);
  		exitcode = 1;
  		goto writeout;

--- 1016,1021 -----
  		if (localize("junk")) {
  			savehist(histline);
+ 			junked = TRUE;
+ 		}
  		exitcode = 1;
  		goto writeout;
***************
*** 1224,1228
  	}
  	xxit((mode == PROC && filename[0] == '\0') ? 0 :
! 		(exitcode < 0 ? 0 : exitcode));
  }
  

--- 1231,1235 -----
  	}
  	xxit((mode == PROC && filename[0] == '\0') ? 0 :
! 		(exitcode < 0 || junked ? 0 : exitcode));
  }
  

-- 
Chip Rosenthal / chip@vector.Dallas.TX.US / Dallas Semiconductor / 214-450-5337

lwk@caen.engin.umich.edu (Woody Kellum) (04/29/89)

rnews -U wouldn't have this problem. Why are you useing inews -U?
Just curious.   
       -Woody
-- 
Woody Kellum   Internet:  lwk@caen.engin.umich.edu
Disclaimer: Whud he say?
The road to success has many parking places - 
and the Usenet news is a veritable drive-in movie.

murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) (04/30/89)

In article <42ec3aa0.b617@june.engin.umich.edu> lwk@caen.UUCP (Woody Kellum) writes:
>rnews -U wouldn't have this problem. Why are you useing inews -U?
>Just curious.   
>       -Woody

Hmm.. maybe that's why.  I didn't think there was a difference in actions
between "inews" and "rnews"...


-- 
Erik Murrey
Lehigh University
murrey@csee.Lehigh.EDU
erik@mpx.com