Date: Fri, 20 Sep 2024 15:04:34 +0100 From: Nuno Teixeira <eduardo@freebsd.org> To: Baptiste Daroussin <bapt@freebsd.org> Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: cd5e0d8a5152 - main - deskutils/i3status: fix disk size computation Message-ID: <CAFDf7UJEBGx0b6KqjP=NYtn%2B1YGZsk89fQvQo=WjYFF5Q5GobA@mail.gmail.com> In-Reply-To: <202409200958.48K9w1ZH033587@gitrepo.freebsd.org> References: <202409200958.48K9w1ZH033587@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000007f683406228d85ba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Thank you for fast fix. It's working fine now. Cheers, Baptiste Daroussin <bapt@freebsd.org> escreveu (sexta, 20/09/2024 =C3=A0(s) 10:58): > The branch main has been updated by bapt: > > URL: > https://cgit.FreeBSD.org/ports/commit/?id=3Dcd5e0d8a5152961e09d29f3adfc0a= ec0c3a0d840 > > commit cd5e0d8a5152961e09d29f3adfc0aec0c3a0d840 > Author: Baptiste Daroussin <bapt@FreeBSD.org> > AuthorDate: 2024-09-20 09:53:59 +0000 > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > CommitDate: 2024-09-20 09:55:04 +0000 > > deskutils/i3status: fix disk size computation > --- > deskutils/i3status/Makefile | 1 + > .../i3status/files/patch-src_print__disk__info.c | 27 > ++++++++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/deskutils/i3status/Makefile b/deskutils/i3status/Makefile > index ac092d08f292..147ff2732704 100644 > --- a/deskutils/i3status/Makefile > +++ b/deskutils/i3status/Makefile > @@ -1,5 +1,6 @@ > PORTNAME=3D i3status > PORTVERSION=3D 2.15 > +PORTREVISION=3D 1 > CATEGORIES=3D deskutils > MASTER_SITES=3D http://i3wm.org/i3status/ > > diff --git a/deskutils/i3status/files/patch-src_print__disk__info.c > b/deskutils/i3status/files/patch-src_print__disk__info.c > new file mode 100644 > index 000000000000..e81b89e4e05d > --- /dev/null > +++ b/deskutils/i3status/files/patch-src_print__disk__info.c > @@ -0,0 +1,27 @@ > +--- src/print_disk_info.c.orig 2024-08-19 16:28:44 UTC > ++++ src/print_disk_info.c > +@@ -73,13 +73,13 @@ static bool below_threshold(struct statvfs buf, cons= t > + } else if (strcasecmp(threshold_type, "percentage_avail") =3D=3D 0)= { > + return 100.0 * (double)buf.f_bavail / (double)buf.f_blocks < > low_threshold; > + } else if (strcasecmp(threshold_type, "bytes_free") =3D=3D 0) { > +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || > defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) > ++#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__= ) > + return (double)buf.f_bsize * (double)buf.f_bfree < low_threshol= d; > + #else > + return (double)buf.f_frsize * (double)buf.f_bfree < > low_threshold; > + #endif > + } else if (strcasecmp(threshold_type, "bytes_avail") =3D=3D 0) { > +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || > defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) > ++#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__= ) > + return (double)buf.f_bsize * (double)buf.f_bavail < > low_threshold; > + #else > + return (double)buf.f_frsize * (double)buf.f_bavail < > low_threshold; > +@@ -198,7 +198,7 @@ void print_disk_info(disk_info_ctx_t *ctx) { > + char string_percentage_used[STRING_SIZE]; > + char string_percentage_avail[STRING_SIZE]; > + > +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || > defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) > ++#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__= ) > + print_bytes_human(string_free, (uint64_t)buf.f_bsize * > (uint64_t)buf.f_bfree, ctx->prefix_type); > + print_bytes_human(string_used, (uint64_t)buf.f_bsize * > ((uint64_t)buf.f_blocks - (uint64_t)buf.f_bfree), ctx->prefix_type); > + print_bytes_human(string_total, (uint64_t)buf.f_bsize * > (uint64_t)buf.f_blocks, ctx->prefix_type); > --=20 Nuno Teixeira FreeBSD UNIX: <eduardo@FreeBSD.org> Web: https://FreeBSD.org --0000000000007f683406228d85ba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello,</div><div><br></div><div>Thank you for fast fi= x. It's working fine now.</div><div><br></div><div>Cheers,<br></div><di= v><br></div><div><br></div></div><br><div class=3D"gmail_quote"><div dir=3D= "ltr" class=3D"gmail_attr">Baptiste Daroussin <<a href=3D"mailto:bapt@fr= eebsd.org">bapt@freebsd.org</a>> escreveu (sexta, 20/09/2024 =C3=A0(s) 1= 0:58):<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0= px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The branc= h main has been updated by bapt:<br> <br> URL: <a href=3D"https://cgit.FreeBSD.org/ports/commit/?id=3Dcd5e0d8a5152961= e09d29f3adfc0aec0c3a0d840" rel=3D"noreferrer" target=3D"_blank">https://cgi= t.FreeBSD.org/ports/commit/?id=3Dcd5e0d8a5152961e09d29f3adfc0aec0c3a0d840</= a><br> <br> commit cd5e0d8a5152961e09d29f3adfc0aec0c3a0d840<br> Author:=C2=A0 =C2=A0 =C2=A0Baptiste Daroussin <bapt@FreeBSD.org><br> AuthorDate: 2024-09-20 09:53:59 +0000<br> Commit:=C2=A0 =C2=A0 =C2=A0Baptiste Daroussin <bapt@FreeBSD.org><br> CommitDate: 2024-09-20 09:55:04 +0000<br> <br> =C2=A0 =C2=A0 deskutils/i3status: fix disk size computation<br> ---<br> =C2=A0deskutils/i3status/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 1 +<br> =C2=A0.../i3status/files/patch-src_print__disk__info.c=C2=A0 =C2=A0| 27 +++= +++++++++++++++++++<br> =C2=A02 files changed, 28 insertions(+)<br> <br> diff --git a/deskutils/i3status/Makefile b/deskutils/i3status/Makefile<br> index ac092d08f292..147ff2732704 100644<br> --- a/deskutils/i3status/Makefile<br> +++ b/deskutils/i3status/Makefile<br> @@ -1,5 +1,6 @@<br> =C2=A0PORTNAME=3D=C2=A0 =C2=A0 =C2=A0 i3status<br> =C2=A0PORTVERSION=3D=C2=A0 =C2=A02.15<br> +PORTREVISION=3D=C2=A0 1<br> =C2=A0CATEGORIES=3D=C2=A0 =C2=A0 deskutils<br> =C2=A0MASTER_SITES=3D=C2=A0 <a href=3D"http://i3wm.org/i3status/" rel=3D"no= referrer" target=3D"_blank">http://i3wm.org/i3status/</a><br> <br> diff --git a/deskutils/i3status/files/patch-src_print__disk__info.c b/desku= tils/i3status/files/patch-src_print__disk__info.c<br> new file mode 100644<br> index 000000000000..e81b89e4e05d<br> --- /dev/null<br> +++ b/deskutils/i3status/files/patch-src_print__disk__info.c<br> @@ -0,0 +1,27 @@<br> +--- src/print_disk_info.c.orig 2024-08-19 16:28:44 UTC<br> ++++ src/print_disk_info.c<br> +@@ -73,13 +73,13 @@ static bool below_threshold(struct statvfs buf, const = <br> +=C2=A0 =C2=A0 =C2=A0} else if (strcasecmp(threshold_type, "percentage= _avail") =3D=3D 0) {<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 100.0 * (double)buf.f_bavail / (d= ouble)buf.f_blocks < low_threshold;<br> +=C2=A0 =C2=A0 =C2=A0} else if (strcasecmp(threshold_type, "bytes_free= ") =3D=3D 0) {<br> +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Open= BSD__) || defined(__DragonFly__) || defined(__APPLE__)<br> ++#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (double)buf.f_bsize * (double)buf= .f_bfree < low_threshold;<br> + #else<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (double)buf.f_frsize * (double)bu= f.f_bfree < low_threshold;<br> + #endif<br> +=C2=A0 =C2=A0 =C2=A0} else if (strcasecmp(threshold_type, "bytes_avai= l") =3D=3D 0) {<br> +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Open= BSD__) || defined(__DragonFly__) || defined(__APPLE__)<br> ++#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (double)buf.f_bsize * (double)buf= .f_bavail < low_threshold;<br> + #else<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (double)buf.f_frsize * (double)bu= f.f_bavail < low_threshold;<br> +@@ -198,7 +198,7 @@ void print_disk_info(disk_info_ctx_t *ctx) {<br> +=C2=A0 =C2=A0 =C2=A0char string_percentage_used[STRING_SIZE];<br> +=C2=A0 =C2=A0 =C2=A0char string_percentage_avail[STRING_SIZE];<br> + <br> +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Open= BSD__) || defined(__DragonFly__) || defined(__APPLE__)<br> ++#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)<= br> +=C2=A0 =C2=A0 =C2=A0print_bytes_human(string_free, (uint64_t)buf.f_bsize *= (uint64_t)buf.f_bfree, ctx->prefix_type);<br> +=C2=A0 =C2=A0 =C2=A0print_bytes_human(string_used, (uint64_t)buf.f_bsize *= ((uint64_t)buf.f_blocks - (uint64_t)buf.f_bfree), ctx->prefix_type);<br= > +=C2=A0 =C2=A0 =C2=A0print_bytes_human(string_total, (uint64_t)buf.f_bsize = * (uint64_t)buf.f_blocks, ctx->prefix_type);<br> </blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre= fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l= tr"><div><font color=3D"#888888">Nuno Teixeira</font></div><div><div><font = color=3D"#888888"> FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 <a h= ref=3D"https://FreeBSD.org" rel=3D"noreferrer" target=3D"_blank">https://Fr= eeBSD.org</a><br></font></div></div></div></div> --0000000000007f683406228d85ba--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7UJEBGx0b6KqjP=NYtn%2B1YGZsk89fQvQo=WjYFF5Q5GobA>