From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54878) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6KzK-0003TY-Rg for guix-patches@gnu.org; Mon, 24 Feb 2020 16:10:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6KzJ-00048T-TL for guix-patches@gnu.org; Mon, 24 Feb 2020 16:10:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6KzJ-00048P-Pb for guix-patches@gnu.org; Mon, 24 Feb 2020 16:10:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j6KzJ-0005Q3-II for guix-patches@gnu.org; Mon, 24 Feb 2020 16:10:01 -0500 Subject: [bug#39734] [PATCH] scripts: Emit GC hint if free space is lower than absolute and relative threshold. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87wo8ccmd3.fsf@ambrevar.xyz> <20200224132024.5790-1-mail@ambrevar.xyz> Date: Mon, 24 Feb 2020 22:08:54 +0100 In-Reply-To: <20200224132024.5790-1-mail@ambrevar.xyz> (Pierre Neidhardt's message of "Mon, 24 Feb 2020 14:20:24 +0100") Message-ID: <87v9nvelqx.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Pierre Neidhardt Cc: 39734@debbugs.gnu.org Pierre Neidhardt skribis: > * guix/scripts.scm (%disk-space-warning-absolute): New variable. > (warn-about-disk-space): Test against %disk-space-warning-absolute. > Fix error in display-hint due to extraneous 'profile' argument. [...] > + (let* ((default-absolute-threshold (size->number "5GiB")) > + (default-relative-threshold 0.05) > + (percentage->float (lambda (percentage) > + (or (and=3D> (string->number > + (car (string-split percentage = #\%))) Mayes just: (string-drop-right percentage 1). > + (absolute? (lambda (size) > + (if (string-suffix? "%" size) > + #f > + (false-if-exception (<=3D 100 (size->number si= ze))))))) Maybe: (not (or (string-suffix? =E2=80=A6) (false-if-exception =E2=80=A6))) Otherwise LGTM. Thank you! Ludo=E2=80=99, who actually saw the warning way too often. :-)