[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: better filtering (was Re: e-mailing list for suck?)




 > From: http://dummy.us.eu.org/robert (robert)
 > Date: Tue  Nov 19,  9:48am
 >
 > 
 >  > From: "Robert A. Yetman" <http://www.pixi.com/~boby>
 >  > Date: Mon  Nov 18,  4:37pm
 >  >
 >  > On Sun, 17 Nov 1996, Robert wrote:
 >  > 
 >  > > 
 >  > > I think the most confusing part is that there's no indication on the standard
 >  > > output which articles are actually not included -- I kept assuming that the
 >  > > articles were all being included when selection was in fact going on.
 >  > > 
 >  > 
 >  > That is what the KILLFILE_LOG is for, perhaps I should change this from
 >  > a compile-time to a run-time option, and force the default to having 
 >  > the log.
 >  > 
 >  > http://www.pixi.com/~boby (Robert A. Yetman)
 >  > 
 > 
 > Well, I did finally figure out that articles were getting killed once I looked
 > in the suck.killlog, but when it was counting out the articles, it didn't say
 > (for example) "20 articles skipped" or something.  Anyway, maybe this is a
 > feature request that's too difficult.
 > 
 > BTW, my hack [fix!] to suck seems to be working.  I'll know for sure today and
 > will send you a patch as soon as I'm assured.
 > 

Okay, I'm gunna send you my patch.  It's for suck 3.3.0.  Here are the changes:

1) Make -b? not require the name of a file (will just go to standard output).
2) Made "430 Article unavailable" not not update sucknewsrc with the "-c"
   option.

*** suck.c.orig	Wed Nov 27 12:52:03 1996
--- suck.c	Wed Nov 27 13:04:18 1996
***************
*** 471,481 ****
  #else
  				retval = get_one_article(master, logcount);
  #endif
  				master->curr = (master->curr)->next; 	/* get next article */
   
  		 	} /* end while */
  			fclose(logfp);
! 			if(retval == RETVAL_OK && master->nritems == master->itemon) {
  				unlink(full_path(FP_GET, FP_TMPDIR, N_RESTART));
  			}
  #ifdef TIMER
--- 471,484 ----
  #else
  				retval = get_one_article(master, logcount);
  #endif
+ 				if (retval == RETVAL_ARTICLEUNAVAIL) {
+ 					retval = RETVAL_OK;
+ 				}
  				master->curr = (master->curr)->next; 	/* get next article */
   
  		 	} /* end while */
  			fclose(logfp);
! 			if((retval == RETVAL_ARTICLEUNAVAIL || retval == RETVAL_OK) && master->nritems == master->itemon) {
  				unlink(full_path(FP_GET, FP_TMPDIR, N_RESTART));
  			}
  #ifdef TIMER
***************
*** 645,651 ****
  	DIR *dptr;
  	struct dirent *entry;
  
! 	if((fptr = fopen(master->batchfile, "w")) == NULL) {
  		MyPerror(master->batchfile);
  		retval = RETVAL_ERROR;
  	}
--- 648,656 ----
  	DIR *dptr;
  	struct dirent *entry;
  
! 	if (master->batchfile[0] == '\0') {
! 		fptr = stdout;
! 	} else if((fptr = fopen(master->batchfile, "w")) == NULL) {
  		MyPerror(master->batchfile);
  		retval = RETVAL_ERROR;
  	}
***************
*** 720,726 ****
  #ifdef DEBUG2
  						do_debug("BATCH FILE: %s\n", buf);
  #endif
! 						if((fptr = fopen(buf, "w")) == NULL) {
  							MyPerror(buf);
  							retval = RETVAL_ERROR;
  						}
--- 725,733 ----
  #ifdef DEBUG2
  						do_debug("BATCH FILE: %s\n", buf);
  #endif
! 						if (buf[0] == '\0') {
! 							fptr = stdout;
! 						} else if((fptr = fopen(buf, "w")) == NULL) {
  							MyPerror(buf);
  							retval = RETVAL_ERROR;
  						}
***************
*** 797,802 ****
--- 804,810 ----
  	  case RETVAL_ERROR:
  		retval = RETVAL_ERROR;
  		break;
+ 	  case RETVAL_ARTICLEUNAVAIL:
  	  case RETVAL_UNEXPECTEDANS:	/* just skip to next article */
  		break;
  	}
***************
*** 986,992 ****
  				}
  			}
  		}
! 		if (good_response != 0 && nr != good_response) {
  			error_log(ERRLOG_REPORT,"*** Unexpected response to command: %s\n%s\n", cmd,resp);
  			retval = RETVAL_UNEXPECTEDANS;
  		}
--- 994,1002 ----
  				}
  			}
  		}
! 		if (nr == 430) {
! 			retval = RETVAL_ARTICLEUNAVAIL;
! 		} else if (good_response != 0 && nr != good_response) {
  			error_log(ERRLOG_REPORT,"*** Unexpected response to command: %s\n%s\n", cmd,resp);
  			retval = RETVAL_UNEXPECTEDANS;
  		}
***************
*** 1124,1131 ****
  					break;
  			  	}
  				if(retval == RETVAL_OK && loop+1 == argc) {
! 					error_log(ERRLOG_REPORT, "No Batch file name provided\n");
! 					retval = RETVAL_ERROR;
  				}
  				else {
  					master->batchfile = argv[++loop];
--- 1134,1140 ----
  					break;
  			  	}
  				if(retval == RETVAL_OK && loop+1 == argc) {
! 					master->batchfile = "";
  				}
  				else {
  					master->batchfile = argv[++loop];
*** suck.h.orig	Wed Nov 27 12:52:04 1996
--- suck.h	Wed Nov 27 13:04:20 1996
***************
*** 42,47 ****
  void free_one_node(PList);
  int send_command(PMaster, const char *, char **, int);
  
! enum { RETVAL_ERROR = -1, RETVAL_OK = 0, RETVAL_NOARTICLES, RETVAL_UNEXPECTEDANS, RETVAL_VERNR, RETVAL_NOAUTH };
  
  #endif /* _SUCK_SUCK_H */
--- 42,47 ----
  void free_one_node(PList);
  int send_command(PMaster, const char *, char **, int);
  
! enum { RETVAL_ERROR = -1, RETVAL_OK = 0, RETVAL_NOARTICLES, RETVAL_UNEXPECTEDANS, RETVAL_VERNR, RETVAL_NOAUTH, RETVAL_ARTICLEUNAVAIL };
  
  #endif /* _SUCK_SUCK_H */
*** man/suck.1.orig	Wed Nov 27 12:54:45 1996
--- man/suck.1	Wed Nov 27 12:57:47 1996
***************
*** 40,46 ****
  ]
  [
  .BI \-b[ir]
! batchfile
  ]
  [
  .BI \-r
--- 40,46 ----
  ]
  [
  .BI \-b[ir]
! [batchfile]
  ]
  [
  .BI \-r
***************
*** 208,217 ****
  by the \-dm command line option.
  .SH MODE 3 \- Batch mode
  .RS
! %suck \-b[ir] batchfile
  .RE
  .RS
! %suck myhost.com \-b[ir] batchfile
  .RE
  .PP
  Suck will grab news articles from an NNTP server and store them
--- 208,217 ----
  by the \-dm command line option.
  .SH MODE 3 \- Batch mode
  .RS
! %suck \-b[ir] [batchfile]
  .RE
  .RS
! %suck myhost.com \-b[ir] [batchfile]
  .RE
  .PP
  Suck will grab news articles from an NNTP server and store them
***************
*** 221,251 ****
  which can be processed by either innxmit or rnews.
  
  \-bi \- build batch file for innxmit.  The articles are
! left intact, and a batchfile is built with a
! one\-up listing of the full path of each article.
  Then innxmit can be called:
  
  .RS
  %innxmit localhost batchfile
  .RE
  
! \-br \- build batch file for rnews.  The articles are
! concatenated together, with the #!rnews size
! article separator.  This can the be fed to rnews:
  
  .RS
  %rnews \-S localhost batchfile
  .RE
  
! \-r filesize  specify maximum batch file size for rnews.  This option,
! is only meaningful when used with -br above.  This option allows you
! to specify the maximum size of a batch file to be fed to rnews.  When
! this limit is reached, a new batch file is created AFTER I finish
! writing the current article to the old batch file.  The second and
! successive batch files get a 1 up sequence number attached to the
! file name specified with the -br.  Note that since I have to finish
! writing out the current article after reaching the limit, the
! max file size is only approximate.
  
  .SH SUCK ARGUMENT FILE
  .PP
--- 221,253 ----
  which can be processed by either innxmit or rnews.
  
  \-bi \- build batch file for innxmit.  The articles are
! left intact, and, if provided, a batchfile is built with a
! one\-up listing of the full path of each article.  If no batchfile is
! provided, the articles are dumped to the standard output.
  Then innxmit can be called:
  
  .RS
  %innxmit localhost batchfile
  .RE
  
! \-br \- build batch file for rnews.  The articles are concatenated
! together, with the #!rnews size article separator.  If no batchfile is
! provided, the articles are dumped to the standard output.  This can the be
! fed to rnews:
  
  .RS
  %rnews \-S localhost batchfile
  .RE
  
! \-r filesize specify maximum batch file size for rnews.  This option, is
! only meaningful when used with -br above and when a batchfile is provided.
! This option allows you to specify the maximum size of a batch file to be
! fed to rnews.  When this limit is reached, a new batch file is created
! AFTER I finish writing the current article to the old batch file.  The
! second and successive batch files get a 1 up sequence number attached to
! the file name specified with the -br.  Note that since I have to finish
! writing out the current article after reaching the limit, the max file
! size is only approximate.
  
  .SH SUCK ARGUMENT FILE
  .PP







Why do you want this page removed?