🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #9394

Re: tin: How to save articles to a newsgroup directory hierarchy?

#9394
From: Kevin Rodgers
Date: Mon, 06 Jun 1994 15:32
59 lines
2952 bytes
I wrote:
>With rn, I was able to save articles to a newsgroup directory hierarchy
>by specifying the -/ option on the command line, or in (a file named by)
>the RNINIT environment variable.  For instance, saving an article in
>gnu.emacs.announce to "emacs-20.1" would actually write it to the file
>~/News/gnu/emacs/announce/emacs-20.1.
>
>Now with tin [1.2 PL2], it seems that I'll have to maintain the group
>attributes file, with two lines for each newsgroup to which I'm
>subscribed:
>
>	newsgroup=gnu.emacs.announce
>	savedir=gnu/emacs/announce

Actually, since the attribute's savedir isn't interpreted relative to
the global savedir, the second line should be

	savedir=~/News/gnu/emacs/announce

>1. Is there another way to emulate rn's -/ option?  Otherwise I'll end
>   up automating the attributes file updates with make & sed.

No one has responded with another way, so I'll post my solution:

(1) Rename your current attributes file to save any group attributes
    you've set:

	mv ~/.tin/attributes ~/.tin/attributes.default

(2) Create ~/.tin/Makefile that appends a savedir line to the default
    attributes for each subscribed newsgroup:

attributes: attributes.default $(HOME)/.newsrc
	-rm -f $@
	cat attributes.default > $@
	echo '# The following lines have been added automatically by $HOME/.tin/Makefile' >> $@
	grep -v ! $(HOME)/.newsrc | \
	sed -e 's/:.*$$//' | \
	nawk '{ \
		printf "\nnewsgroup=%s\nsavedir=~/News/", $$0; \
		gsub("\\.", "/", $$0); print $$0; \
	}' >> $@

    If your system doesn't have nawk, you can use this awk command instead:

	awk -F. '{ \
		printf "\nnewsgroup=%s\nsavedir=~/News/", $$0; \
		ORS = "/"; for (i = 1; i < NF; i++) print $$i; printf "%s\n", $$NF; \
	}'

(3) Define a C shell alias to automatically update the attributes file
    after reading news:

	alias tin 'tin \!* && (cd ~/.tin; make)'
-- 
Kevin Rodgers <kevinr@ihs.com>		Project Engineer
Information Handling Services		Electronic Systems Development
15 Inverness Way East, M/S A203		
Englewood CO 80112 USA			(303) 397-2807[voice]/-2620[fax]
Technical Details
Message-ID: <2svfhh$9gb@ihs.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!hookup!swrinde!emory!europa.eng.gtefsd.com!sundog.tiac.net!usenet.elf.com!rpi!psinntp!ihs.com!kevinr
References: <2sl12g$9m0@ihs.com>

Show Full Headers
Complete Article Headers
Message-ID: <2svfhh$9gb@ihs.com>
Subject: Re: tin: How to save articles to a newsgroup directory hierarchy?
Date: Mon, 06 Jun 1994 15:32:01 +0000
From: kevinr@sauron.ihs.com (Kevin Rodgers)
References: <2sl12g$9m0@ihs.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!hookup!swrinde!emory!europa.eng.gtefsd.com!sundog.tiac.net!usenet.elf.com!rpi!psinntp!ihs.com!kevinr
Newsgroups: news.software.readers
Organization: Information Handling Services, Electronic Systems Development
Lines: 59
Reply-To: Kevin Rodgers <kevinr@ihs.com>
NNTP-Posting-Host: firewall.ihs.com
X-Newsreader: TIN [version 1.2 PL2]