Created attachment 224474 [details] SHAR file with port contents Did my best to build a port for it, since it was on the wishlist... portlint looked fine, followed the porter's handbook and tested on amd64 in different constellations / different python versions. Discus is a program to display hard drive space usage, much like the standard UNIX command df. Discus aims to make df(1) prettier. Features include color, bar graphs, and smart formatting of numbers (automatically choosing the most suitable size from kilobytes, megabytes, gigabytes, or terabytes). Or choose your own size, along with specifying the number of decimal places you'd like to see.
Created attachment 224496 [details] patch with corrections and more Hi Chris, Thanks for the patch. > Did my best to build a port for it, since it was on the wishlist... Looks nice for a first shot of a new port ;) > portlint looked fine, followed the porter's handbook and tested > on amd64 in different constellations / different python versions. I stumbled over some issues, while trying to build and test your port. - The first line in Makefile (# $FreeBSD$) is not needed any more, after the ports tree is converted from svn to git - If you like it, a first line like this # Created by: Chris Moerz <freebsd@ny-central.org> can be included. Be warned, this is not very common any more - For me, the port didn't fetch the source. This was because of an uncomplete PORTVERSION, which you tried you overcome by GH_TAGNAME ... Removing the distinfo file and recreating after my changes did it - The minimal Python 3 version nowadays should be 3.6+ - USE_PYTHON=allflavors is for 'special cases' (Mk/Uses/python.mk): "Only to be used for py-* ports that are part of the Python distribution, but kept as separate ports" - LICENSE_FILE not needed for this 'standard license' - USES=shebangfix and SHEBANGFIX_FILES instead of post-patch - PORTDOCS not needed here, but something for the case, option DOCS is disabled: 'do-install-DOCS-on:' target should do the trick - New distinfo - pkg-plist: sbin/discus has the rights already. Adding %%PORTDOCS%% makes the DOCS files depending on the option Probably I did not found every issue so far, but let's see ;) If you agree with my suggestion, could you please test it and give some feedback?
(In reply to Rainer Hurling from comment #1) BTW, DOCSDIR= also is not needed here ...
Not to discourage you but does it add/offer something unique compared to sysutils/duf ? FWIW I also have a port of https://github.com/bootandy/dust but I haven't submitted it as I can't reliably build rust on my current hardware fleet.
(In reply to Rainer Hurling from comment #2) Wow, thanks for the thorough and quick feedback. I'm working through it right now. It's my first port. I kind off expected to be off the mark on a few points. Hence, constructive criticism is more than welcome! There's a bunch of items in your list that I didn't get during my first run through the docs. Thanks for those hints - shebang in particular; I grabbed that sed command from another port, though that's obviously no guarantee for choosing the best/easiest way to fix things. I'm removing the header comment in the Makefile. If it ain't common, lets not do that. One thing I did notice, but am unsure whether it is an actual issue: if I have python37 installed, the current Makefile wants me to install python38 irrespective of the already available python37. Is this expected behavior? setenv DEFAULT_VERSIONS "python=3.7 python3=3.7" appears to fix it. I'll be uploading a new shar and diff in a moment. In case a diff suffices and I shouldn't be posting more shars, please let me know so I can do better in the future. Again, thanks for the inputs!
(In reply to daniel.engberg.lists from comment #3) Fair point. I didn't check for alternatives, since I just wanted to try myself at building a port. That one was on the wishlist so it originally wasn't my idea. Personally, I'm fine with df, but discus is a simple python program, which felt easy enough to try as port. It boils down to personal preference whether one likes this one better than the number of other alternatives. I suppose the rust port would go through poudriere and different platform tests before submitting? Can imagine that's a lot more complex that just a single python file...
Created attachment 224507 [details] SHAR file with port contents Updated after feedback with suggested fixes
(In reply to Chris Moerz from comment #6) After uploading the SHAR I realize that it's possible to obsolete the previous SHAR. I'm assuming that makes another diff obsolete. Just let me know in case a diff is still desired and I'll follow up asap. thanks.
(In reply to Chris Moerz from comment #4) > One thing I did notice, but am unsure whether it is an actual issue: > if I have python37 installed, the current Makefile wants me to > install python38 irrespective of the already available python37. > Is this expected behavior? Yes, because Python3 v3.8 is default for some days now. > setenv DEFAULT_VERSIONS "python=3.7 python3=3.7" appears to fix it. This should be used, if you do not want to upgrade towards python3 v3.8, the default version. (In reply to Chris Moerz from comment #7) > After uploading the SHAR I realize that it's possible to obsolete > the previous SHAR. I'm assuming that makes another diff obsolete. Yes, while uploading a new attachment, one can declare a present one obsolote. > Just let me know in case a diff is still desired and I'll follow up asap. thanks. Most maintainers and committers prefer diff files these days. If your new port is added locally to the ports git repository ('git add sysutils/discus'), you just need to run a 'git diff sysutils/discus > patch-file' to get a diff file that can be uploaded here ;) In current case it is not necessary, because I already generated it this way my diff file. Have you been able to test the modified version in the meantime? Does everything work as expected? If so and if you agree, I can commit the port then ...
(In reply to Rainer Hurling from comment #8) > Have you been able to test the modified version in the meantime? > Does everything work as expected? Yes, I reran tests with python 3.7 and python 3.8; worked like a charm. Document option works as expected as well. Disabling option via make config leads to /usr/local/share/doc/discus not being created as expected. > If so and if you agree, I can commit the port then ... Yes, completely agree. The only thing I changed in the updated shar was removing the header comment with the "created by" statement. I don't mind whether it's in or not. Thanks for your help!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=05e3a02e1fc88ccf60655d50f32f372372ba6bbb commit 05e3a02e1fc88ccf60655d50f32f372372ba6bbb Author: Chris Moerz <freebsd@ny-central.org> AuthorDate: 2021-04-28 19:06:14 +0000 Commit: Rainer Hurling <rhurlin@FreeBSD.org> CommitDate: 2021-04-28 19:06:14 +0000 New port: sysutils/discus: Similar to df but nicer output Changelog: https://github.com/ncarrier/discus/blob/master/changelog PR: 255442 sysutils/discus/Makefile (new) | 32 ++++++++++++++++++++ sysutils/discus/distinfo (new) | 3 ++ sysutils/discus/files/patch-README.md (new) | 36 ++++++++++++++++++++++ sysutils/discus/files/patch-discus.1 (new) | 43 ++++++++++++++++++++++++++ sysutils/discus/files/patch-discus.py (new) | 47 +++++++++++++++++++++++++++++ sysutils/discus/files/patch-discusrc (new) | 25 +++++++++++++++ sysutils/discus/pkg-descr (new) | 13 ++++++++ sysutils/discus/pkg-plist (new) | 5 +++ 8 files changed, 204 insertions(+)
Hi Chris, Congrats on your first port! Have fun. Committed, thanks :)