* [9front] news(1) patch: make -a and -n get along
@ 2021-01-24 10:28 Lyndon Nerenberg
2021-01-24 18:13 ` ori
0 siblings, 1 reply; 13+ messages in thread
From: Lyndon Nerenberg @ 2021-01-24 10:28 UTC (permalink / raw)
To: 9front
[-- 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);
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-24 10:28 [9front] news(1) patch: make -a and -n get along Lyndon Nerenberg
@ 2021-01-24 18:13 ` ori
2021-01-24 19:03 ` Stanley Lieber
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: ori @ 2021-01-24 18:13 UTC (permalink / raw)
To: 9front
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?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-24 18:13 ` ori
@ 2021-01-24 19:03 ` Stanley Lieber
2021-01-24 19:14 ` ori
` (3 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Stanley Lieber @ 2021-01-24 19:03 UTC (permalink / raw)
To: 9front
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-24 18:13 ` ori
2021-01-24 19:03 ` Stanley Lieber
@ 2021-01-24 19:14 ` ori
2021-01-24 21:48 ` Noam Preil
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: ori @ 2021-01-24 19:14 UTC (permalink / raw)
To: 9front
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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-24 18:13 ` ori
2021-01-24 19:03 ` Stanley Lieber
2021-01-24 19:14 ` ori
@ 2021-01-24 21:48 ` Noam Preil
2021-01-25 0:59 ` Lyndon Nerenberg
2021-01-25 7:30 ` telephil9
4 siblings, 0 replies; 13+ messages in thread
From: Noam Preil @ 2021-01-24 21:48 UTC (permalink / raw)
To: 9front
I use it with an rss feed reader.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-24 18:13 ` ori
` (2 preceding siblings ...)
2021-01-24 21:48 ` Noam Preil
@ 2021-01-25 0:59 ` Lyndon Nerenberg
[not found] ` <38af8e19-8e85-4131-8d92-5a29bc02932a@sirjofri.de>
2021-01-25 7:30 ` telephil9
4 siblings, 1 reply; 13+ messages in thread
From: Lyndon Nerenberg @ 2021-01-25 0:59 UTC (permalink / raw)
To: 9front, ori
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-24 18:13 ` ori
` (3 preceding siblings ...)
2021-01-25 0:59 ` Lyndon Nerenberg
@ 2021-01-25 7:30 ` telephil9
2021-01-25 7:42 ` Kurt H Maier
2021-01-25 16:26 ` Lyndon Nerenberg
4 siblings, 2 replies; 13+ messages in thread
From: telephil9 @ 2021-01-25 7:30 UTC (permalink / raw)
To: 9front
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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-25 7:30 ` telephil9
@ 2021-01-25 7:42 ` Kurt H Maier
2021-01-25 16:26 ` Lyndon Nerenberg
1 sibling, 0 replies; 13+ messages in thread
From: Kurt H Maier @ 2021-01-25 7:42 UTC (permalink / raw)
To: 9front
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-25 7:30 ` telephil9
2021-01-25 7:42 ` Kurt H Maier
@ 2021-01-25 16:26 ` Lyndon Nerenberg
2021-01-25 16:50 ` hiro
2021-01-25 17:44 ` Stanley Lieber
1 sibling, 2 replies; 13+ messages in thread
From: Lyndon Nerenberg @ 2021-01-25 16:26 UTC (permalink / raw)
To: 9front, telephil9
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
[not found] ` <38af8e19-8e85-4131-8d92-5a29bc02932a@sirjofri.de>
@ 2021-01-25 16:27 ` Lyndon Nerenberg
0 siblings, 0 replies; 13+ messages in thread
From: Lyndon Nerenberg @ 2021-01-25 16:27 UTC (permalink / raw)
To: 9front, sirjofri
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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-25 16:26 ` Lyndon Nerenberg
@ 2021-01-25 16:50 ` hiro
2021-01-25 19:42 ` ori
2021-01-25 17:44 ` Stanley Lieber
1 sibling, 1 reply; 13+ messages in thread
From: hiro @ 2021-01-25 16:50 UTC (permalink / raw)
To: 9front
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
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-25 16:26 ` Lyndon Nerenberg
2021-01-25 16:50 ` hiro
@ 2021-01-25 17:44 ` Stanley Lieber
1 sibling, 0 replies; 13+ messages in thread
From: Stanley Lieber @ 2021-01-25 17:44 UTC (permalink / raw)
To: 9front
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [9front] news(1) patch: make -a and -n get along
2021-01-25 16:50 ` hiro
@ 2021-01-25 19:42 ` ori
0 siblings, 0 replies; 13+ messages in thread
From: ori @ 2021-01-25 19:42 UTC (permalink / raw)
To: 9front
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.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-01-27 11:45 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 10:28 [9front] news(1) patch: make -a and -n get along Lyndon Nerenberg
2021-01-24 18:13 ` ori
2021-01-24 19:03 ` Stanley Lieber
2021-01-24 19:14 ` ori
2021-01-24 21:48 ` Noam Preil
2021-01-25 0:59 ` Lyndon Nerenberg
[not found] ` <38af8e19-8e85-4131-8d92-5a29bc02932a@sirjofri.de>
2021-01-25 16:27 ` Lyndon Nerenberg
2021-01-25 7:30 ` telephil9
2021-01-25 7:42 ` Kurt H Maier
2021-01-25 16:26 ` Lyndon Nerenberg
2021-01-25 16:50 ` hiro
2021-01-25 19:42 ` ori
2021-01-25 17:44 ` Stanley Lieber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).