Re: [ANNOUNCE] procps 4.0.3 rc1

"Dr. Werner Fink" <[email protected]> Thu, 9 Feb 2023 11:07:55 +0100
Newsgroups gmane.linux.procps.devel
Message-ID <[email protected]>
--JE+nGIJ5ezxQRlGY
Content-Type: multipart/mixed; boundary="fb80Chvr9ymyCWrG"
Content-Disposition: inline


--fb80Chvr9ymyCWrG
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2023/01/28 13:06:55 +1100, Craig Small wrote:
> The first release candidate for procps 4.0.3 was tagged and uploaded toda=
y.
> I'd appreciate people test it out so we can have a nice quick turn-around
> for 4.0.3 proper.
>=20
> Files are at:
> https://sourceforge.net/projects/procps-ng/files/Translators/
> https://gitlab.com/procps-ng/procps/-/tags/v4.0.3_rc1

Disabling translation make it build and packaged.
Just a simple patch for w(1) ... an option which forces it not to
truncate its output.  To see more of the command the output
is more compressed.

Werner

--=20
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

--fb80Chvr9ymyCWrG
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
	filename="procps-ng-3.3.9-w-notruncate.diff"
Content-Transfer-Encoding: quoted-printable

---
 man/w.1 |    3 +++
 src/w.c |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

--- man/w.1
+++ man/w.1	2023-02-08 08:51:13.971987652 +0000
@@ -40,6 +40,9 @@ and a
 \fB\-s\fR, \fB\-\-short\fR
 Use the short format.  Don't print the login time, JCPU or PCPU times.
 .TP
+\fB\-n\fR, \fB\-\-no\-truncat\fR
+Do not truncate the output format. This option might become renamed in fut=
ure versions.
+.TP
 \fB\-f\fR, \fB\-\-from\fR
 Toggle printing the
 .B from
--- src/w.c
+++ src/w.c	2023-02-08 08:53:39.785313401 +0000
@@ -455,7 +455,7 @@ static int find_best_proc(
=20
 static void showinfo(
             utmp_t * u, int formtype, int maxcmd, int from,
-            const int userlen, const int fromlen, const int ip_addresses,
+            int userlen, int fromlen, const int ip_addresses,
             const int pids)
 {
     unsigned long long jcpu, pcpu;
@@ -489,7 +489,13 @@ static void showinfo(
     strncpy(uname, u->ut_user, UT_NAMESIZE);
=20
     if (formtype) {
-        printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, u->ut_line);
+	int utlnlen =3D 8;
+	if (formtype > 1) {
+	    userlen =3D strnlen(uname, UT_NAMESIZE);
+	    fromlen =3D strnlen(u->ut_host, UT_HOSTSIZE);
+	    utlnlen =3D strnlen(u->ut_line, UT_LINESIZE);
+	}
+	printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen,=
 u->ut_line);
         if (from)
             print_from(u, ip_addresses, fromlen);
 #ifdef HAVE_UTMPX_H
@@ -542,6 +548,7 @@ static void __attribute__ ((__noreturn__
 	fputs(_(" -h, --no-header     do not print header\n"),out);
 	fputs(_(" -u, --no-current    ignore current process username\n"),out);
 	fputs(_(" -s, --short         short format\n"),out);
+	fputs(_(" -n, --no-truncat    non truncated listing (large)\n"),out);
 	fputs(_(" -f, --from          show remote hostname field\n"),out);
 	fputs(_(" -o, --old-style     old style output\n"),out);
 	fputs(_(" -i, --ip-addr       display IP address instead of hostname (if =
possible)\n"), out);
@@ -580,6 +587,7 @@ int main(int argc, char **argv)
 		{"no-header", no_argument, NULL, 'h'},
 		{"no-current", no_argument, NULL, 'u'},
 		{"short", no_argument, NULL, 's'},
+		{"no-truncat", no_argument, NULL, 'n'},
 		{"from", no_argument, NULL, 'f'},
 		{"old-style", no_argument, NULL, 'o'},
 		{"ip-addr", no_argument, NULL, 'i'},
@@ -602,7 +610,7 @@ int main(int argc, char **argv)
 #endif
=20
 	while ((ch =3D
-		getopt_long(argc, argv, "husfoVip", longopts, NULL)) !=3D -1)
+		getopt_long(argc, argv, "husnfoVip", longopts, NULL)) !=3D -1)
 		switch (ch) {
 		case 'h':
 			header =3D 0;
@@ -610,6 +618,10 @@ int main(int argc, char **argv)
 		case 's':
 			longform =3D 0;
 			break;
+		case 'n':
+			longform =3D 2;
+			header =3D 0;
+			break;
 		case 'f':
 			from =3D !from;
 			break;

--fb80Chvr9ymyCWrG--

--JE+nGIJ5ezxQRlGY
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJgBAABCABKFiEEGwa/WjgpkPvLonW+UOkNVR3Bay4FAmPkxfIsFIAAAAAAFQAO
cGthLWFkZHJlc3NAZ251cGcub3Jnd2VybmVyQHN1c2UuZGUACgkQUOkNVR3Bay7M
XBAA4BuIJg1QyckoWgkwas1erh3Ca3IkVMSOzhP21SLUgaSq6BBC+2EXWDa+z74X
i2P8wyOUFtmWZCvHksFnecAcCWS0kRGbD6IJ+fw68FFwHFDMeUzh719bScszDeaa
yDHt0mcl8jkHialPkYY9Ar90s+jjH3zAM9HesS3bWKMka9t+NpXXd/n3JE+/ww+J
t7VCf6P9aFrhO3pJ/RAUqEG1jArKNjOBrdHycbWzsbNSbKik4uTd6aNQuKGeXPSe
/iSPMvGsn9KNz+4zwhsV2bzifsG0BSY9TC+jvoKWYu163R/UpOSAhv/wQOl6AA6m
gCTXwz62EbwLyvoBV7wMxqKHvPMlT1zdXyyKiHgKqbSwBiFhxhf0sag9cnvQDtAW
bq6liTChrhxX5Oo8Eiw/fvzvBDT0laenSNXJhr7Rr6idoqQckNMqWC0zV13RjUKR
Taym0bisBU9A1z0QAqdUON5igzBWgZrUJntN8+EJ0p+74CzsaAqg3L/JTV8dzD0H
S7QHPYKjt60CEhLG6wEyCxz+wT5YkToS4pFhLjH9uGaOjCsacfJHrnWygITXTXjf
QhihN93ptH2h5JGaH7SNiU2BSuGvaBG+E5+3IF9IfjKcqdeXs6/bxUrbs090ec/Q
O+kXZlP8nXI4xl57mjFFJqYLBVnKWxmrb9qSMjCyYDjRfik=
=QS+O
-----END PGP SIGNATURE-----

--JE+nGIJ5ezxQRlGY--