Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 2023 22:10:30 -0400
From:      Garance A Drosehn <gad@FreeBSD.org>
To:        Jamie Landeg-Jones <jamie@catflap.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: MOTD is not created correctly (since 2022/02/18)
Message-ID:  <F997E470-775E-4F1F-BCC4-F7068F9AF42A@FreeBSD.org>
In-Reply-To: <202305230318.34N3IOaX056503@donotpassgo.dyslexicfish.net>
References:  <202305230318.34N3IOaX056503@donotpassgo.dyslexicfish.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 22 May 2023, at 23:18, Jamie Landeg-Jones wrote:

> I've just finally updated to 13-stable, and can't be the first to 
> notice this?!
>
> /etc/rc.d/motd contains the line:
>
> uname -v | sed -e 's,^\([^#]*\) #\(.* 
> [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,'
>
> Note the space before the "$" - needed because the uname -v output 
> used
> to have a trailing space. This was fixed and comitted on 2022/02/18:
>
> https://cgit.freebsd.org/src/commit/usr.bin/uname/uname.c?id=7e05fa3b449007adaa6e588ebb3b8d76f30b355c
>
> Since then, the sed doesn't match, so the uname(1) output is 
> unchanged.
>
> There's no point altering the sed to work with both possibilities, so 
> can
> someone commit the fix of removing the ' ' before the '$' in 
> /etc/rc.d/motd ?

Not that it helps you much, but I did notice it and have an alternate
version of rc.d/motd on my own systems.  I had no particular attachment
to the earlier format, so my motd starts out by printing the two lines
of:
```
     -KU 1302505 1302505 -b 18fa15f83c483db67b818e3a48bbb312908754b1
FreeBSD 13.2-STABLE (Garance-13x) #0 -- Fri May  5 17:53:55 EDT 2023
```

(that first line is the output from
```printf '    -KU %s -b %s\n' "$(uname -KU)" "$(uname -b)"```
)

But I thought that committing that would trigger a bikeshed debate, so I
also have an option to produce the output we previously had.  And given
that no one seemed to be complaining about the "full uname" version, I
figured I had an option for that too.  And then I thought all these 
options
were overkill and would trigger and even longer debate, so I never 
brought
the ideas forward.   :)

-- 
Garance Alistair Drosehn                =     drosih@rpi.edu
Lead Developer @rpi                   and    gad@FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA

[-- Attachment #2 --]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body><div style="font-family: sans-serif;"><div class="markdown" style="white-space: normal;">
<p dir="auto">On 22 May 2023, at 23:18, Jamie Landeg-Jones wrote:</p>
<blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #777777; color: #777777;">
<p dir="auto">I've just finally updated to 13-stable, and can't be the first to notice this?!</p>
<p dir="auto">/etc/rc.d/motd contains the line:</p>
<p dir="auto">uname -v | sed -e 's,^([^#]<em>) #(.</em> [1-2][0-9][0-9][0-9]).<em>/([^]</em>) $,\1 (\3) #\2,'</p>
<p dir="auto">Note the space before the &quot;$&quot; - needed because the uname -v output used<br>
to have a trailing space. This was fixed and comitted on 2022/02/18:</p>
<p dir="auto"><a href="https://cgit.freebsd.org/src/commit/usr.bin/uname/uname.c?id=7e05fa3b449007adaa6e588ebb3b8d76f30b355c" style="color: #777777;">https://cgit.freebsd.org/src/commit/usr.bin/uname/uname.c?id=7e05fa3b449007adaa6e588ebb3b8d76f30b355c</a></p>;
<p dir="auto">Since then, the sed doesn't match, so the uname(1) output is unchanged.</p>
<p dir="auto">There's no point altering the sed to work with both possibilities, so can<br>
someone commit the fix of removing the ' ' before the '$' in /etc/rc.d/motd ?</p>
</blockquote>
<p dir="auto">Not that it helps you much, but I did notice it and have an alternate<br>
version of rc.d/motd on my own systems.  I had no particular attachment<br>
to the earlier format, so my motd starts out by printing the two lines<br>
of:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; background-color: #F7F7F7; border-radius: 5px 5px 5px 5px; overflow-x: auto; max-width: 90vw;"><code style="margin: 0 0; border-radius: 3px; background-color: #F7F7F7; padding: 0px;">    -KU 1302505 1302505 -b 18fa15f83c483db67b818e3a48bbb312908754b1
FreeBSD 13.2-STABLE (Garance-13x) #0 -- Fri May  5 17:53:55 EDT 2023
</code></pre>
<p dir="auto">(that first line is the output from<br>
<code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">printf '    -KU %s -b %s\n' &quot;$(uname -KU)&quot; &quot;$(uname -b)&quot;</code><br>
)</p>
<p dir="auto">But I thought that committing that would trigger a bikeshed debate, so I<br>
also have an option to produce the output we previously had.  And given<br>
that no one seemed to be complaining about the &quot;full uname&quot; version, I<br>
figured I had an option for that too.  And then I thought all these options<br>
were overkill and would trigger and even longer debate, so I never brought<br>
the ideas forward.   :)</p>
</div><div id="1E5069B8-B094-48FD-8A96-D66CC42C52FB"><!DOCTYPE html><div dir="auto" style="color: rgb(0, 0, 0); font-family: sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-- 
</div><div dir="auto" style="color: rgb(0, 0, 0); font-family: sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Garance Alistair Drosehn                =     drosih@rpi.edu
</div><div dir="auto" style="color: rgb(0, 0, 0); font-family: sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Lead Developer @rpi                   and    gad@FreeBSD.org
</div><div dir="auto" style="color: rgb(0, 0, 0); font-family: sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Rensselaer Polytechnic Institute;             Troy, NY;  USA</div></div>
<div class="markdown" style="white-space: normal;">

</div>
</div>
</body>

</html>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F997E470-775E-4F1F-BCC4-F7068F9AF42A>