From nobody Fri Sep 20 14:04:34 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9DfQ5C42z5XKKs; Fri, 20 Sep 2024 14:04:46 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9DfQ2rxKz4BHN; Fri, 20 Sep 2024 14:04:46 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=//b4ZysWocdbYhOvjCqpSIPsmfrPB41drrCiTQzCjh8=; b=Yy1XwekgVHKWEs87uKMPctmIteZpU8Mgh4mkzHEjhjAu7z+E83tMHEFWQwcl35LAxiXDvr 2pHlnIZpWduLhDErGCxMhrYOczGG+AYYEc7ZmCnKzCEvaJCbD6rPTMJJmkavUTX/0p8K7w KxuGEqbuQdhCJ56M+poWNtvSeb3DLWW5e8SW54NQmpS6BxD+POObQN+LALO+1iqeRSbDwy GqULPXDh9UrtjV0dMNzWO5vBp9pBFfxz3W5TT2MZayKudhrS5z1i+h3uu9DqdNqsjgzBah mTwIrqjITph/uaZY5S1GQ8vH/wJ072de/mGQuMhpG574sUbP24j0uo3uxIJXsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726841086; a=rsa-sha256; cv=none; b=DR1M6+4r/XOCZE0529ulAhkvo7vG+fRMmJeBQ5DvUortyl8ALjL6vldJ1BFKHTYW1eP/CY IQ1uafbtxIa7OXA+Okpxls6Tp8u0M84CdLprf6ki3Yh5HmN3i2s3tcOJWUCn+eM8wmeXkC xvvm77A8agmYhafI4LkqKoCZdsTc5cOtqQ3dJ7UHxpR8rKz+4mV0PA1W137BD/eT/Qyo6K NVVgFVfexplB69HXAlQXxSw/1oMAGqbZb9+Z2DaqheI+RnMrUI+cCoD2KNYqXh/CIMlkCp ziHYOKOXrI+UEjDfdky7uFCXO/+FtmgPBqNvmjA6OMFMAsau12r2TUALnukArQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=//b4ZysWocdbYhOvjCqpSIPsmfrPB41drrCiTQzCjh8=; b=naU+fwtHzbu1wc5P20LwoL5SUeLemmsy/W0rOv9bfwikSQG4U+ilzTL1NxjB3SesMueljd 0V5Zmfas1hnM6br0anoDJeu+YyRu8W7o+cYrPHw2Ohm74UC29D8KRr/c3I+ajUeS4HlijO 9e3pgxjzi9qa/XbfCatC4gtK2NEU4CMbIoHlhuzv0TCSvIFfMQn7ysIrgcIbKeE0DpcNLS 7FbxhPoGTEK0a+dagxs6P6+dySYPR2tWFGLmtUZ5LGgRpUl7+rwYBRjHODOO7LJOvwtpdh 9JJMYg86G2f7S4AOJLsHxWy1DdOWE2Xw928GK32LKfTYAGv2pK86ievgNM70IA== Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X9DfQ2HrwzHY3; Fri, 20 Sep 2024 14:04:46 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-458303a3158so762881cf.1; Fri, 20 Sep 2024 07:04:46 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUNgfeJaQpssamIP1bW41EitNoxRMyL2PfwfVlOYbIww5vlisFRuTJpcnv4M+U5aAFYJTwYOkXBp5TBzsV7W7RppI9vXvE=@freebsd.org, AJvYcCX93SzNN3DtNnQns6unqJaoacWkAqFoTEIrHkq03kG/G/7aZkD0qkWSm5u7yIvwK4Gv1BxXll/Eni79ic0KGTJ02ByzhFNuCw==@freebsd.org X-Gm-Message-State: AOJu0YxL6TSgaaZKIHzF0JRPcb41C2ot5gLqDpAQmXaeMQrkIhO505bD pYl69wNzoz5560cR0WceH+9U00PdBmf/27KgyOHaMn5UlMvgLcRlKUtX8KJ2IzptT6m8vDfTcfO hCjLfFtGecLpgoNtnEiBdcyNzhzc= X-Google-Smtp-Source: AGHT+IGG/bOUY1GK1GVYQzuE9AESpOkfecyBu+2ajvHHhcFc8ZUYTNQs7cW3Ld+p3SDhVfeSYfULq5inOC3gzkxh+pc= X-Received: by 2002:a05:622a:1183:b0:458:21b3:284 with SMTP id d75a77b69052e-45b2055f2e9mr17739291cf.15.1726841085710; Fri, 20 Sep 2024 07:04:45 -0700 (PDT) List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 References: <202409200958.48K9w1ZH033587@gitrepo.freebsd.org> In-Reply-To: <202409200958.48K9w1ZH033587@gitrepo.freebsd.org> From: Nuno Teixeira Date: Fri, 20 Sep 2024 15:04:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: cd5e0d8a5152 - main - deskutils/i3status: fix disk size computation To: Baptiste Daroussin Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000007f683406228d85ba" --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 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 > AuthorDate: 2024-09-20 09:53:59 +0000 > Commit: Baptiste Daroussin > 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: Web: https://FreeBSD.org --0000000000007f683406228d85ba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Thank you for fast fi= x. It's working fine now.

Cheers,



Baptiste Daroussin <bapt@freebsd.org> escreveu (sexta, 20/09/2024 =C3=A0(s) 1= 0:58):
The branc= h main has been updated by bapt:

URL: https://cgi= t.FreeBSD.org/ports/commit/?id=3Dcd5e0d8a5152961e09d29f3adfc0aec0c3a0d840

commit cd5e0d8a5152961e09d29f3adfc0aec0c3a0d840
Author:=C2=A0 =C2=A0 =C2=A0Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2024-09-20 09:53:59 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-09-20 09:55:04 +0000

=C2=A0 =C2=A0 deskutils/i3status: fix disk size computation
---
=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 +
=C2=A0.../i3status/files/patch-src_print__disk__info.c=C2=A0 =C2=A0| 27 +++= +++++++++++++++++++
=C2=A02 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 @@
=C2=A0PORTNAME=3D=C2=A0 =C2=A0 =C2=A0 i3status
=C2=A0PORTVERSION=3D=C2=A0 =C2=A02.15
+PORTREVISION=3D=C2=A0 1
=C2=A0CATEGORIES=3D=C2=A0 =C2=A0 deskutils
=C2=A0MASTER_SITES=3D=C2=A0
http://i3wm.org/i3status/

diff --git a/deskutils/i3status/files/patch-src_print__disk__info.c b/desku= tils/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, const =
+=C2=A0 =C2=A0 =C2=A0} else if (strcasecmp(threshold_type, "percentage= _avail") =3D=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 100.0 * (double)buf.f_bavail / (d= ouble)buf.f_blocks < low_threshold;
+=C2=A0 =C2=A0 =C2=A0} else if (strcasecmp(threshold_type, "bytes_free= ") =3D=3D 0) {
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Open= BSD__) || defined(__DragonFly__) || defined(__APPLE__)
++#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;
+ #else
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (double)buf.f_frsize * (double)bu= f.f_bfree < low_threshold;
+ #endif
+=C2=A0 =C2=A0 =C2=A0} else if (strcasecmp(threshold_type, "bytes_avai= l") =3D=3D 0) {
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Open= BSD__) || defined(__DragonFly__) || defined(__APPLE__)
++#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;
+ #else
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (double)buf.f_frsize * (double)bu= f.f_bavail < low_threshold;
+@@ -198,7 +198,7 @@ void print_disk_info(disk_info_ctx_t *ctx) {
+=C2=A0 =C2=A0 =C2=A0char string_percentage_used[STRING_SIZE];
+=C2=A0 =C2=A0 =C2=A0char string_percentage_avail[STRING_SIZE];
+
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Open= BSD__) || defined(__DragonFly__) || defined(__APPLE__)
++#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);
+=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); +=C2=A0 =C2=A0 =C2=A0print_bytes_human(string_total, (uint64_t)buf.f_bsize = * (uint64_t)buf.f_blocks, ctx->prefix_type);


--
Nuno Teixeira
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--0000000000007f683406228d85ba--