🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
11 messages
11 total messages Started by Dan Hartung Mon, 24 May 1993 19:37
trn & newsrc file getting unreasonable
#4229
Author: Dan Hartung
Date: Mon, 24 May 1993 19:37
30 lines
2105 bytes
My site has been receiving news via the uunet satellite connection
for a few months now, and this means we have access to gazillions
of newsgroups from around the world.  (Cool!)

The problem is that there are as many as 20 new groups on a given day
and I don't like to subscribe to them all at once.  Previously my
practice was to say "N" so that all of them would be added unsubscribed,
and later I would go thru and fiddle with the .newsrc file so that 
they would be placed where I wanted and so forth. 

Unfortunately, and I don't know if this is a direct result of the
large feed we get or not, but I certainly experience it more often --
when I try to do a "vi .newsrc" I get a "line too long" error when
it reaches a group with a large volume of posts and a motley collection
of post numbers.  

Someone suggested emacs, but that seems to choke too, and I really don't
have any idea how to use it.

How do other users handle this?  I know it's possible to search for
unsubbed groups with the 'l' command, thus bypassing direct editing
of the file, but then I don't get to put them in order -- e.g. my
rec.arts.startrek.reviews group is 'way far from the rest of the r.a.s.
hierarchy.  

Am I missing something fairly simple?

-- 
 |   Oh wad some Pow'r the giftie gie us to see oursel's as others see us   |
 Daniel A. Hartung  --  dhartung@chinet.chinet.com  --  Ask me about Rotaract
Re: trn & newsrc file getting unreasonable
#4241
Author: Paul Smee
Date: Tue, 25 May 1993 09:10
30 lines
2284 bytes
In article <C7JqHq.Mn7@chinet.chinet.com> dhartung@chinet.chinet.com (Dan Hartung) writes:
>Unfortunately, and I don't know if this is a direct result of the
>large feed we get or not, but I certainly experience it more often --
>when I try to do a "vi .newsrc" I get a "line too long" error when
>it reaches a group with a large volume of posts and a motley collection
>of post numbers.  

Unless you've got really wierd reading habits, the problem groups won't
be ones that you read, but rather groups which get lots of articles
crossposted to them from groups that you read.  Some few releases ago,
trn's 'chasing Xrefs' code changed so that it insists on putting lines
for such groups into your .newsrc as it does its xrefs chasing.

Given that, a solution with usually works is:

    grep : .newsrc > temp.newsrc
    mv temp.newsrc .newsrc

This basically cleans out all the lines in your .newsrc which refer to
groups you don't subscribe to.  Note you've GOT to use a temporary file,
as trying to grep from .newsrc straight into .newsrc will trash the file
completely.  (Standard Unix IO redirection hazard.)

Of course, trn will then slowly begin slipping the excess baggage back
into your .newsrc, so you've got to do this every month or so if you're
trying to minimize your .newsrc.  If you don't care, then just try this
before trying to edit the file.
-- 
Paul Smee, Computing Service, University of Bristol, Bristol BS8 1UD, UK
     P.Smee@bristol.ac.uk - Tel +44 272 303132 - FAX +44 272 291576
Re: trn & newsrc file getting unreasonable
#4246
Author: Mark Bixby
Date: Tue, 25 May 1993 15:44
14 lines
1342 bytes
We use the following shell script to condense our .newsrc files:

#!/bin/csh
mv .newsrc .newsrc.old
awk 'NF<2  { print $0 } \
     NF>=2 { j=split($2, arr1, ",") \
             k=split(arr1[j], arr2, "-") \
             printf "%s 1-%s\n", $1, arr2[k] } ' < .newsrc.old > .newsrc
-- 
Mark Bixby                         Internet: markb@cccd.edu
Coast Community College District   1370 Adams Avenue
District Information Services      Costa Mesa, CA, USA  92626
Technical Support                  (714) 432-5064
"You can tune a file system, but you can't tune a fish." - tunefs(1M)
Re: trn & newsrc file getting unreasonable
#4250
Author: Arjan de Vet
Date: Tue, 25 May 1993 16:55
24 lines
1742 bytes
In article <C7JqHq.Mn7@chinet.chinet.com> dhartung@chinet.chinet.com (Dan
Hartung) writes:

>Unfortunately, and I don't know if this is a direct result of the
>large feed we get or not, but I certainly experience it more often --
>when I try to do a "vi .newsrc" I get a "line too long" error when
>it reaches a group with a large volume of posts and a motley collection
>of post numbers.  

At the university I use a program called newsclean which `cleanes' the
.newsrc file by joining lots of ranges

	a-b,c-d,e-f,...

into one range 1-end (taking into account expired articles) and removes
these numbers from unsubscribed newsgroups.  I'm now at home so I can't
check whether I still have the source. If so, I'll put available for ftp on
ftp.win.tue.nl:/pub/news.

Arjan

--
Arjan de Vet                             <Arjan.de.Vet@adv.win.tue.nl> (home)
Eindhoven University of Technology, the Netherlands <devet@win.tue.nl> (work)
Re: trn & newsrc file getting unreasonable
#4262
Author: Dick Grady
Date: Thu, 27 May 1993 02:47
33 lines
2059 bytes
In article <C7Ks4w.J23@bristol.ac.uk> P.Smee@bristol.ac.uk (Paul Smee) writes:
>In article <C7JqHq.Mn7@chinet.chinet.com> dhartung@chinet.chinet.com (Dan Hartung) writes:
>>Unfortunately, and I don't know if this is a direct result of the
>>large feed we get or not, but I certainly experience it more often --
>>when I try to do a "vi .newsrc" I get a "line too long" error when
>>it reaches a group with a large volume of posts and a motley collection
>>of post numbers.  
>
>Unless you've got really wierd reading habits, the problem groups won't
>be ones that you read, but rather groups which get lots of articles
>crossposted to them from groups that you read.  Some few releases ago,
>trn's 'chasing Xrefs' code changed so that it insists on putting lines
>for such groups into your .newsrc as it does its xrefs chasing.
>
>Given that, a solution with usually works is:
>
>    grep : .newsrc > temp.newsrc
>    mv temp.newsrc .newsrc

grep also has line-length limitations also.  From the manual page
for grep:

  BUGS
     Lines are limited to 1024 characters by grep;  longer  lines
     are truncated.

So, if any of your wanted newsgroups also have these long lines (some of
mine do, because I don't get to read them very often), then the above
procedure will corrupt those lines.

-- 
Dick Grady           Salem, NH,  USA            grady@world.std.com
So many newsgroups, so little time!
Re: trn & newsrc file getting unreasonable
#4291
Author: Felan shena Thoron'edras
Date: Fri, 28 May 1993 20:59
30 lines
1721 bytes
In article <1ttj26$9o@adv.win.tue.nl> devet@adv.win.tue.nl (Arjan de Vet) writes:
>At the university I use a program called newsclean which `cleanes' the
>.newsrc file by joining lots of ranges
>
>	a-b,c-d,e-f,...
>
>into one range 1-end (taking into account expired articles) and removes
>these numbers from unsubscribed newsgroups.  I'm now at home so I can't

When I asked a similar question a year or more ago, Jonathan Kamens provided
me with this little number:

---
#!/bin/sed -f

s/! *\([0-9][0-9]*\).*[,-]\([0-9][0-9]*\)$/! \1-\2/
---
I run it as:

$ fix.newsrc .newsrc > new.newsrc

(or was that < .newsrc > new.newsrc?  I can't remember any more, foo.  I
always have to figure it out every time.)

and then rename new.newsrc.  It's very effective.

Felan shena Thoron'edras
"Go not unto the Elves for counsel, for they will say both yea and nay."
"Now is _not_ a good time, Keiko!" - Worf, "Disaster"
"Variety is the spice of life, and I don't want to die." - Scott Borst
Re: trn & newsrc file getting unreasonable
#4348
Author: Jon Cargille
Date: Thu, 03 Jun 1993 15:18
38 lines
2200 bytes
In article <1ttj26$9o@adv.win.tue.nl> devet@adv.win.tue.nl (Arjan de Vet) writes:
>
>At the university I use a program called newsclean which `cleanes' the
>.newsrc file by joining lots of ranges
>
>	a-b,c-d,e-f,...
>
>into one range 1-end (taking into account expired articles) and removes
>these numbers from unsubscribed newsgroups.  I'm now at home so I can't
>check whether I still have the source. If so, I'll put available for ftp on
>ftp.win.tue.nl:/pub/news.
>
>Arjan

I checked out this source, based on the above description.  However,
it didn't do what was advertised (at least from what I could tell),
either in the above post, or the accompanying documentation.  Maybe
it's due to the fact that I read via nntp.  I didn't dig too deeply
into the source.

At any rate, I found that it *always* marked read all articles up to
the highest-read article number.  It did not seem to take into account
whether articles were expired or not.  Since I often read a few
articles in a group, and want the others to stay around until they are
either read or expire, this doesn't do what I want at all.

Anyone have a tool which *does* take into account whether articles are
expired (and handles checking this via NNTP), and only removes ranges
from the .newsrc which are actually expired?

Thanks for the info,

Jon
-- 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
Jon Cargille		jcargill@cs.wisc.edu
Want your .sig compressed?  Reasonable rates
and fast turnaround. Call today!
Re: trn & newsrc file getting unreasonable
#4349
Author: Curt Welch
Date: Thu, 03 Jun 1993 17:20
24 lines
1881 bytes
In news.software.readers, jcargill@oka.cs.wisc.edu (Jon Cargille) writes:
>Anyone have a tool which *does* take into account whether articles are
>expired (and handles checking this via NNTP), and only removes ranges
>from the .newsrc which are actually expired?

tnews will correctly update the range in your .newsrc file, but there's no
simple way to to get it to clean up your entire .newsrc file.  It will
only update the lines that have changed durring your session.  So you
have to read at least one article from each group you want tnews to clean 
up.

Even with article ranges cleand up, I found I had a few newgroups with lines
that were too long for vi.  But that was easilly fixed by just junking all the
articles in those groups.  They were all groups that I didn't read.  The
sparse set of articles were marked as read because they were cross posted to
groups that I do read.

If you want to try out tnews, you can get it by anonymous ftp from
oasys.dt.navy.mil as src/tnews1.36.tar.Z.  If you don't have ftp access,
I can mail you a copy.

I plan to post it to one of the sources groups when I find the time.

Curt
Re: trn & newsrc file getting unreasonable
#4361
Author: Hans de Graaff
Date: Fri, 04 Jun 1993 09:21
29 lines
2147 bytes
In article <1993Jun3.151848.19271@cs.wisc.edu> jcargill@oka.cs.wisc.edu (Jon Cargille) writes:
>In article <1ttj26$9o@adv.win.tue.nl> devet@adv.win.tue.nl (Arjan de Vet) writes:
>>At the university I use a program called newsclean which `cleanes' the
>>.newsrc file by joining lots of ranges
>
>At any rate, I found that it *always* marked read all articles up to
>the highest-read article number.  It did not seem to take into account
>whether articles were expired or not.  Since I often read a few
>articles in a group, and want the others to stay around until they are
>either read or expire, this doesn't do what I want at all.
>
>Anyone have a tool which *does* take into account whether articles are
>expired (and handles checking this via NNTP), and only removes ranges
>from the .newsrc which are actually expired?

I have patched a version of fixnewsrc. It knows how to sort your
.newsrc, possibly based on special criteria. My patch also strips of
the article numbers of unread groups. It doesn't do exactly what you
want, but it will shrink your .newsrc, and leave read groups in their
current state. You can ftp it from dutiws.twi.tudelft.nl:/pub/news

BTW: It's in perl.

Hans
-- 
Hans de Graaff                  | I want someone to follow,
J.J.deGraaff@IS.TWI.TUDelft.NL  |   who doesn't lead the way
Department of Informatics       | I want someone to listen,
Delft University of Technology  |   who won't repeat what I say
Re: trn & newsrc file getting unreasonable
#4368
Author: Dana Carson
Date: Fri, 04 Jun 1993 22:14
92 lines
3213 bytes
   Here is a little perl script I wrote that clean you .newsrc without
deleting article numbers of articles that you marked to look at later
unless they have expired off your system.  It's a first attempt to write
a perl program rather then a one-liner so it can be improved I'm sure.
It seems to work however and I tested the obvious error conditions, no
directory, no articles, no list etc.

------------------------------------------------------------------------
#!/usr/local/bin/perl 
$NEWSDIR = "/usr/spool/news/";

if ($ARGV[0] ) {
	open(rcfile,$ARGV[0]) || die "Can't open $ARGV[0]";
} 
else {
	open(rcfile,".newsrc") || die "Can't open .newsrc";
}
while (<rcfile>) {
	($group, $seen) = split;
	print $group, " ";
	# if we read this group we need to trim expired gaps
	# if not an empty list will work
	if ($group =~ /:/) {
		( $GROUPDIR = $group ) =~ s;\.;/;g ;
		$GROUPDIR =~ s;:;/;g ;
		if (!opendir(CURDIR, $NEWSDIR . $GROUPDIR)) {
			print " \n";
			next;
		}
		@filenames = readdir(CURDIR);
		closedir(CURDIR);

		#find the ones that are numeric and therefore probably articles
		@articles = ();
		for (@filenames) {
			if(/^\d+$/) {
				push(@articles,$_);
			}
		}
		@articles = sort bynumber @articles;

		# if there are no articles go on to next group
		if (!defined($articles[0])) {
			print $seen,"\n";
			next;
		}
		$curlow = $articles[0];

		#break up the seen list
	 	@seen = split(/,/,$seen);
		while (@seen) {
			#find any gaps where the articles have expired
			#close up the gaps
			if ($seen[0] =~ /-/) {
	 			($clow,$chigh) = split(/-/,$seen[0]);
				last if $clow > $curlow;
				if ($chigh < $curlow) {
					shift(@seen);
					next;
				}
				else {
					$curlow = $chigh;
					shift(@seen);
					last;
				}
			}
			else {
				last if $seen[0] > $curlow;
				shift(@seen);
			}
		}
		@nlist = "1-".$curlow;
		@nlist = (@nlist,@seen);

		print join(",",@nlist);

		#write out the updated seen list
	}
	print "\n";
}

sub bynumber {
	$a <=> $b;
}
----------------------------------------------------------------------
--
Dana Carson
Westinghouse Electronic Systems Group  Mail Stop 1615
net: carson@tron.bwi.wec.com     | 
     ...!uunet!tron!carson       | This message on recycled bits.
AT&T: (410) 765-3513             |
WIN:  285-3513                   |
Re: trn & newsrc file getting unreasonable
#4473
Author: Wayne Davison
Date: Fri, 11 Jun 1993 16:05
16 lines
1435 bytes
According to Curt Welch <curt@oasys.dt.navy.mil>:
> tnews will correctly update the range in your .newsrc file [... It will]
> only update the lines that have changed durring your session.  So you
> have to read at least one article from each group you want tnews to clean 
> up.

Trn is better in this area -- it updates all subscribed groups and you only
have to browse by it in the newsgroup selection mode.

The problem was the unsubscribed groups getting too long, and people that
have checked out the 3.0 release may note that the default for most people
is to not add unsubscribed groups to your .newsrc.  Of course, if you liked
the old behavior, just specify -I (include unsubscribed groups) and you'll
be all set.

.wayne..
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads