Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!hao!hplabs!parcvax!unlv!greg From: greg@unlv.UUCP (Greg Wohletz) Newsgroups: net.news.sa,net.news.adm Subject: newsgroup exclusion in expire Message-ID: <131@csee-vax.unlv.UUCP> Date: Tue, 11-Feb-86 05:51:23 EST Article-I.D.: csee-vax.131 Posted: Tue Feb 11 05:51:23 1986 Date-Received: Sun, 16-Feb-86 04:26:22 EST Reply-To: greg@unlv.UUCP (Greg Wohletz) Organization: University of Nevada, Las Vegas Lines: 99 Xref: watmath net.news.sa:233 net.news.adm:514 I recently modified expire.c to allow for the -o option which is the same as the -n option except that it excludes the named groups from those expired instead of expireing only those groups (ie expire -o mod.sources runs expire on all groups except mod.sources). The patch follows, I thought someone might find it usefull: --Greg Wohletz greg%unlv@CSNet-Relay seismo!unrvax!unlv!greg ---------------------------cut here------------------------------ *** /tmp/,RCSt1001149 Tue Feb 11 02:43:49 1986 --- /tmp/,RCSt2001149 Tue Feb 11 02:43:53 1986 *************** *** 42,47 **** --- 42,48 ---- int usepost = 0; int frflag = 0; int updateactive = 0; + int invert = 0; char baduser[BUFLEN]; extern char filename[], nbuf[]; *************** *** 146,157 **** ignorexp = 1; break; case 'n': if (argc > 2) { argv++; argc--; while (argc > 1 && argv[1][0] != '-') { if (ngpatlen + strlen(argv[1]) + 2 > LBUFLEN) { ! fprintf(stderr,"Too many groups specified for -n\n"); xxit(1); } strcat(ngpat, argv[1]); --- 147,160 ---- ignorexp = 1; break; case 'n': + case 'o': + invert = (argv[1][1] == 'o'); if (argc > 2) { argv++; argc--; while (argc > 1 && argv[1][0] != '-') { if (ngpatlen + strlen(argv[1]) + 2 > LBUFLEN) { ! fprintf(stderr,"Too many groups specified for -%c\n",argv[1][1]); xxit(1); } strcat(ngpat, argv[1]); *************** *** 373,379 **** grpsleft[0] = '\0'; goto checkdate; } ! if (!ngmatch(nbuf, ngpat) || ((h.rectime+expincr > now) && !dorebuild && !frflag && !usepost && h.recdate[0] != ' ')) goto keephist; --- 376,383 ---- grpsleft[0] = '\0'; goto checkdate; } ! if ((invert && ngmatch(nbuf, ngpat)) || ! (!invert && !ngmatch(nbuf, ngpat)) || ((h.rectime+expincr > now) && !dorebuild && !frflag && !usepost && h.recdate[0] != ' ')) goto keephist; *************** *** 381,386 **** --- 385,392 ---- ** Look for the file--possibly several times, ** if it was posted to several news groups. */ + if(verbose > 1 && invert) + printf("Looking at %s\n",nbuf); dc = ' '; p3 = p2; while (dc != '\n') { *************** *** 745,751 **** /* should be impossible to get here */ } fn = dirname(artlist); ! if (ngmatch(newname, ngpat)) { if (doarchive){ if (ngmatch(newname, arpat)) { q = fn + strlen(SPOOL) + 1; --- 751,757 ---- /* should be impossible to get here */ } fn = dirname(artlist); ! if ((ngmatch(newname, ngpat) && !invert) || (!ngmatch(newname,ngpat) && invert)) { if (doarchive){ if (ngmatch(newname, arpat)) { q = fn + strlen(SPOOL) + 1;