[-- Attachment #1: Type: text/plain, Size: 143 bytes --] [ I sent this to 9front-bugs but that copy seems to have been swallowed by a black home. ] This patch makes 'news -an' do the right thing. [-- Attachment #2: Type: text/plain, Size: 1147 bytes --] /n/dump/2021/0122/sys/src/cmd/news.c:44,65 - news.c:44,72 void main(int argc, char *argv[]) { - int i; + int i, aflag = 0, nflag = 0; + int doupdate = 1; + int printall = 0; + void (*printer)(char*) = print_item; Binit(&bout, 1, OWRITE); if(argc == 1) { - eachitem(print_item, 0, 1); + eachitem(print_item, printall, doupdate); exits(0); } ARGBEGIN{ case 'a': /* print all */ - eachitem(print_item, 1, 0); + doupdate = 0; + printall = 1; + // eachitem(print_item, 1, 0); break; case 'n': /* names only */ - eachitem(note, 0, 0); - if(n_items) - Bputc(&bout, '\n'); + doupdate = 0; + printer = note; + // eachitem(note, 0, 0); + // if(n_items) + // Bputc(&bout, '\n'); break; default: /n/dump/2021/0122/sys/src/cmd/news.c:66,73 - news.c:73,87 fprint(2, "news: bad option %c\n", ARGC()); exits("usage"); }ARGEND - for(i=0; i<argc; i++) - print_item(argv[i]); + + if (argc == 0){ + eachitem(printer, printall, doupdate); + }else{ + for(i=0; i<argc; i++) + print_item(argv[i]); + } + if (n_items) + Bputc(&bout, '\n'); exits(0); }
Quoth Lyndon Nerenberg <lyndon@orthanc.ca>:
> [ I sent this to 9front-bugs but that copy seems to have
> been swallowed by a black home. ]
>
> This patch makes 'news -an' do the right thing.
Seems ok, but:
% ls /lib/news
<nothing>
% ls /n/9pio/plan9/lib/news
<nothing>
I'm not aware of anyone or anything populating that
directory. Am I wrong?
On January 24, 2021 1:13:23 PM EST, ori@eigenstate.org wrote:
>Quoth Lyndon Nerenberg <lyndon@orthanc.ca>:
>> [ I sent this to 9front-bugs but that copy seems to have
>> been swallowed by a black home. ]
>>
>> This patch makes 'news -an' do the right thing.
>
>Seems ok, but:
>
> % ls /lib/news
> <nothing>
> % ls /n/9pio/plan9/lib/news
> <nothing>
>
>I'm not aware of anyone or anything populating that
>directory. Am I wrong?
>
>
it's not an automated service, it's like an motd.
sl
Quoth ori@eigenstate.org:
> Quoth Lyndon Nerenberg <lyndon@orthanc.ca>:
> > [ I sent this to 9front-bugs but that copy seems to have
> > been swallowed by a black home. ]
> >
> > This patch makes 'news -an' do the right thing.
>
> Seems ok, but:
>
> % ls /lib/news
> <nothing>
> % ls /n/9pio/plan9/lib/news
> <nothing>
>
> I'm not aware of anyone or anything populating that
> directory. Am I wrong?
Also, can you regenerate the patch with
`diff -u` or `ape/diff -u`, ideally with
the commented code removed?
The current format can't be applied with
ape/patch, and I don't feel like rewriting
it by hand.
I use it with an rss feed reader.
ori@eigenstate.org writes:
> % ls /lib/news
> <nothing>
>
> I'm not aware of anyone or anything populating that
> directory. Am I wrong?
It's a site-local thing. If you want something to show
up in news(1) you just create a file in that directory.
It's a manual process.
--lyndon
Quoth ori@eigenstate.org:
> I'm not aware of anyone or anything populating that
> directory. Am I wrong?
>
We could use this to have some 9front community news with a news file published through 9p.
On Mon, Jan 25, 2021 at 08:30:05AM +0100, telephil9@gmail.com wrote:
> Quoth ori@eigenstate.org:
> > I'm not aware of anyone or anything populating that
> > directory. Am I wrong?
> >
>
> We could use this to have some 9front community news with a news file published through 9p.
>
It's hard to find someone dumb enough to write a news update on a
regular basis for any sustained amount of time for a small audience with
a narrow focus.
I recommend crowdsourcing it instead of trying something so outlandish
alone.
khm
> We could use this to have some 9front community news with a news file publishe
> d through 9p.
I keep a /lib/news/changelog that announces local changes to the
network's users. I don't see why the 9front distribution couldn't
maintain something similar in /lib/news/9front as part of the hg
repo. E.g. to note things like the recent upas changes.
--lyndon
That's an interesting idea. I'd never thought of auto- populating the directory like that. Then again, I like to keep news(1) very low bandwidth.
there's a simple reason:
we already are used to notifications like this to be sent to the mailinglist.
changing everything bec. of the technical "novelty" isn't a great idea.
i like how the RSS example is reusing this old convention though :D
On 1/25/21, Lyndon Nerenberg <lyndon@orthanc.ca> wrote:
>> We could use this to have some 9front community news with a news file
>> publishe
>> d through 9p.
>
> I keep a /lib/news/changelog that announces local changes to the
> network's users. I don't see why the 9front distribution couldn't
> maintain something similar in /lib/news/9front as part of the hg
> repo. E.g. to note things like the recent upas changes.
>
> --lyndon
>
On January 25, 2021 11:26:14 AM EST, Lyndon Nerenberg <lyndon@orthanc.ca> wrote:
>> We could use this to have some 9front community news with a news file publishe
>> d through 9p.
>
>I keep a /lib/news/changelog that announces local changes to the
>network's users. I don't see why the 9front distribution couldn't
>maintain something similar in /lib/news/9front as part of the hg
>repo. E.g. to note things like the recent upas changes.
>
>--lyndon
>
why not arrange for each binary to print a list of recent changes to its source code upon first run by each user?
sl
Quoth hiro <23hiro@gmail.com>:
> there's a simple reason:
>
> we already are used to notifications like this to be sent to the mailinglist.
>
> changing everything bec. of the technical "novelty" isn't a great idea.
Though, it may not be a bad option for a
migration guide that gets shown on sysupdate.
Changes show up in 'sysupdate -i' as well
as the mailing list, but for things like
dp9ik, arm64 rootstub, and so on, having
a "how to do the manual steps to migrate"
on sysupdate has seemed like a good idea.