Bug 267710 - net/pload: fix command-line args, fix unit display and fix %d format expansion
Summary: net/pload: fix command-line args, fix unit display and fix %d format expansion
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mikael Urankar
URL: https://www.freshports.org/net/pload/
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-11 13:19 UTC by J.R. Oldroyd
Modified: 2023-01-16 17:38 UTC (History)
2 users (show)

See Also:
fbsd: maintainer-feedback+


Attachments
patch to fix command-line args and fix unit display (7.83 KB, patch)
2022-11-11 13:19 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff
patch to fix %d expansion in -iformat and -oformat arguments (748 bytes, patch)
2023-01-13 03:27 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff
patch to fix command-line args, unit display and %d expansion (7.78 KB, patch)
2023-01-13 16:14 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff
patch to fix command-line args, unit display and %d expansion (7.68 KB, patch)
2023-01-15 16:55 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff
patch to fix command-line args, unit display and %d expansion (7.67 KB, patch)
2023-01-15 16:58 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J.R. Oldroyd 2022-11-11 13:19:53 UTC
Created attachment 238015 [details]
patch to fix command-line args and fix unit display

This patch updates the port to fix the fact that the code calls XtAppInitialize() which eats the command-line args and so causes ps(1) to not display them.  The command-line args are now saved before and restored after the call to XtAppInitialize().

Also, correct the display of the units of total byte counts to show as "B", "kB", "GB" etc, rather than the imprecise/incorrect "b", "k", "G" etc.

I have updated all the patches using "make makepatch" which has caused files/patch-ioctl_stats.c to be renamed to files/patch-ioctl__stat.c.
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-12-30 11:33:40 UTC
Triage: ready for someone to commit? 

We have the flag, 

     maintainer-approval+
Comment 2 J.R. Oldroyd 2023-01-13 03:27:59 UTC
Created attachment 239432 [details]
patch to fix %d expansion in -iformat and -oformat arguments

Since this hasn't yet been committed, here is an additional patch to fix another bug.

Currently, if "%d" appears in an -iformat or -oformat <fmt> argument, it _replaces_ the contents of the buffer so far.  It should _append_ to the buffer as do all the other format specifiers.

The second patch fixes this.

The patches in both attachments need applying.
Comment 3 J.R. Oldroyd 2023-01-13 16:14:15 UTC
Created attachment 239447 [details]
patch to fix command-line args, unit display and %d expansion

On discovery that this app divides bit counts by 1024 and not 1000, further change units to kiB, MiB, Gib.

While here, to simplify things, I am combining both these patches into one.
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2023-01-15 13:58:29 UTC
(In reply to J.R. Oldroyd from comment #3)
Your patch fails to apply:
error: git apply: bad git-diff - inconsistent old filename on line 50
Comment 5 J.R. Oldroyd 2023-01-15 16:55:42 UTC
Created attachment 239490 [details]
patch to fix command-line args, unit display and %d expansion

Updated the patch to use same paths now.
Comment 6 J.R. Oldroyd 2023-01-15 16:58:33 UTC
Created attachment 239491 [details]
patch to fix command-line args, unit display and %d expansion

And also fix one additional path in a rename command.
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-01-16 17:34:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=82f36772565dc3bcf17661df5ac8360c85fe426c

commit 82f36772565dc3bcf17661df5ac8360c85fe426c
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2023-01-16 16:56:29 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-01-16 17:33:55 +0000

    net/pload: Fix command-line args and unit display.

    This patch updates the port to fix the fact that the code calls
    XtAppInitialize() which eats the command-line args and so causes ps(1)
    to not display them. The command-line args are now saved before and restored
    after the call to XtAppInitialize().

    Also, correct the display of the units of total byte counts to show as "B",
    "kB", "GB" etc, rather than the imprecise/incorrect "b", "k", "G" etc.

    PR:             267710
    Approved by:    J.R. Oldroyd (maintainer)

 net/pload/Makefile                                 |   2 +-
 net/pload/files/patch-Imakefile                    |  31 ++---
 .../{patch-ioctl_stats.c => patch-ioctl__stat.c}   |  10 +-
 net/pload/files/patch-pload.c                      | 147 +++++++++++----------
 net/pload/files/patch-pload.man                    |   8 +-
 5 files changed, 95 insertions(+), 103 deletions(-)
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 2023-01-16 17:35:33 UTC
Thanks!
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-01-16 17:38:04 UTC
A commit in branch 2023Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bb77c48ee538332836ef00f03257316b65fac316

commit bb77c48ee538332836ef00f03257316b65fac316
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2023-01-16 16:56:29 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-01-16 17:34:20 +0000

    net/pload: Fix command-line args and unit display.

    This patch updates the port to fix the fact that the code calls
    XtAppInitialize() which eats the command-line args and so causes ps(1)
    to not display them. The command-line args are now saved before and restored
    after the call to XtAppInitialize().

    Also, correct the display of the units of total byte counts to show as "B",
    "kB", "GB" etc, rather than the imprecise/incorrect "b", "k", "G" etc.

    PR:             267710
    Approved by:    J.R. Oldroyd (maintainer)

    (cherry picked from commit 82f36772565dc3bcf17661df5ac8360c85fe426c)

 net/pload/Makefile                                 |   2 +-
 net/pload/files/patch-Imakefile                    |  31 ++---
 .../{patch-ioctl_stats.c => patch-ioctl__stat.c}   |  10 +-
 net/pload/files/patch-pload.c                      | 147 +++++++++++----------
 net/pload/files/patch-pload.man                    |   8 +-
 5 files changed, 95 insertions(+), 103 deletions(-)