From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +LR8Ju1x12GAUAAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 23:49:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id sAIfH+1x12GTiQAAG6o9tA (envelope-from ) for ; Thu, 06 Jan 2022 23:49:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 74B7036710 for ; Thu, 6 Jan 2022 23:49:16 +0100 (CET) Received: from localhost ([::1]:43926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5bZL-0007R4-Lj for larch@yhetil.org; Thu, 06 Jan 2022 17:49:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bZ8-0007P1-Px for guix-patches@gnu.org; Thu, 06 Jan 2022 17:49:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bZ8-00074Q-GO for guix-patches@gnu.org; Thu, 06 Jan 2022 17:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5bZ8-00004u-Fq for guix-patches@gnu.org; Thu, 06 Jan 2022 17:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53063] [PATCH wip-harden-installer 01/14] installer: Use define instead of let at top-level. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 22:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53063 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53063@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 53063-submit@debbugs.gnu.org id=B53063.164150931632569 (code B ref 53063); Thu, 06 Jan 2022 22:49:02 +0000 Received: (at 53063) by debbugs.gnu.org; 6 Jan 2022 22:48:36 +0000 Received: from localhost ([127.0.0.1]:42576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5bYh-0008T8-OX for submit@debbugs.gnu.org; Thu, 06 Jan 2022 17:48:36 -0500 Received: from jpoiret.xyz ([206.189.101.64]:35884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5bYg-0008Sz-MI for 53063@debbugs.gnu.org; Thu, 06 Jan 2022 17:48:35 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id C7518184D98; Thu, 6 Jan 2022 22:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1641509314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AYAELU2YYSxP6xZiza7ofFvxFOT2oqZL5X+TXp7zLvg=; b=tHjU7Ove1ede1OZBIF+opNUgkRUgtaW6kImHVBa/PQSXmbORCucHJjEEC7wGer7tDYuCHl cXbPiARbTktRDVZ50Eauswmb8taIb7YNGaocCFfqxK+MDV8/V4CjBWBosveAEWo4DYGdZa PgOMmPWJ/S+xGRYwyvKH/rawUDFkKCEbgOaCK1CfKPF/bFY0zANNVeVfjlo9iGaI9KgLcZ 1YCY9QnbDFzTBda3krblkvhhCzn9icx0NxeEbe2pzQoXUBFEOm6rfbaIvo8NC5WLIdjFKu JzckvK54xfdBgZUqBB7ycF+PSszp+TyuPi1CXCbey3W4Dk338Z6EuVZFzlqCNw== Date: Thu, 6 Jan 2022 23:47:59 +0100 Message-Id: <5eec8987674e650ca14b1b1b3e8a211d10e772fd.1641507696.git.dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641509357; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=AYAELU2YYSxP6xZiza7ofFvxFOT2oqZL5X+TXp7zLvg=; b=uc5ch7ePBVJtsd+GRG9EEY5oK8ZwsmZiiGc5e09AoOiQ6CUv+IljEd+u0H8mrLUqT3vWD8 MrkRVPZO9h3pUVZ+NZZaw7W9tFhHhTGwbnTBNKb7Tsd5Tk6eiQ1goFxFgTqSeenU5JkY2l Q/eO86TFbtg758TGuEjx52/gnLjCTk3Q3UR1W+JgiPoQUIGPjHAWAuSNw2iED5JEwQTOcy RFUaUw4ZESHExNWi9+z0waA97YAz3BXzP8Gezx5Dw5vju2aTdn5k+T88yk/2rAqVE8hiYE 9VPNMxJmcgq/Ps96P/UgjVwOPdJkHZjSiQ+bUAXb0WgquLt8NXNPkGsL7VthBQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641509357; a=rsa-sha256; cv=none; b=e2FoKSEYwVTFkHtSPjoWx3FUHF7B2JMIfoPAdIh9So+OoMilp8X7S3X8J6kqJb+4g4DWb2 QNaGdad2abHP9zlbHUjqbs5wOP0CEVuSKgxZh6Hbn9EdsaN6eH5jngFP/UC9/n7yt8m6gJ BP5UUAyiFyswUgNouXJIdVp1XmCqG2YVIMsUqqLzE0jO5cGUFD1HQSZzMAh3ztBG26EWPf dj6czuyDFpsO7tgh8khAafmrsak1vUEqutYFypOOtxl7EXVoJMx0mszllkC8in00dLiIhW SncQQfnzh0OJP9Tiy4JsTtm3DYKcuL7w0UlO30AS5hRh+aAEjrIo56JVDJSrDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=tHjU7Ove; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.10 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=tHjU7Ove; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 74B7036710 X-Spam-Score: -3.10 X-Migadu-Scanner: scn1.migadu.com X-TUID: Ytd9Ux9xyQAq * gnu/installer.scm (installer-program): Improve readability by using define at top-level. --- gnu/installer.scm | 88 +++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index d57b1d673a..134fa2faaf 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -412,50 +412,50 @@ (define installer-builder ;; verbose. (terminal-width 200) - (let* ((current-installer newt-installer) - (steps (#$steps current-installer))) - ((installer-init current-installer)) - - (catch #t - (lambda () - (define results - (run-installer-steps - #:rewind-strategy 'menu - #:menu-proc (installer-menu-page current-installer) - #:steps steps)) - - (match (result-step results 'final) - ('success - ;; We did it! Let's reboot! - (sync) - (stop-service 'root)) - (_ - ;; The installation failed, exit so that it is restarted - ;; by login. - #f))) - (const #f) - (lambda (key . args) - (syslog "crashing due to uncaught exception: ~s ~s~%" - key args) - (let ((error-file "/tmp/last-installer-error") - (dump-archive "/tmp/dump.tgz")) - (call-with-output-file error-file - (lambda (port) - (display-backtrace (make-stack #t) port) - (print-exception port - (stack-ref (make-stack #t) 1) - key args))) - (make-dump dump-archive - #:result %current-result - #:backtrace error-file) - (let ((report - ((installer-dump-page current-installer) - dump-archive))) - ((installer-exit-error current-installer) - error-file report key args))) - (primitive-exit 1))) - - ((installer-exit current-installer))))))) + (define current-installer newt-installer) + (define steps (#$steps current-installer)) + ((installer-init current-installer)) + + (catch #t + (lambda () + (define results + (run-installer-steps + #:rewind-strategy 'menu + #:menu-proc (installer-menu-page current-installer) + #:steps steps)) + + (match (result-step results 'final) + ('success + ;; We did it! Let's reboot! + (sync) + (stop-service 'root)) + (_ + ;; The installation failed, exit so that it is restarted + ;; by login. + #f))) + (const #f) + (lambda (key . args) + (syslog "crashing due to uncaught exception: ~s ~s~%" + key args) + (let ((error-file "/tmp/last-installer-error") + (dump-archive "/tmp/dump.tgz")) + (call-with-output-file error-file + (lambda (port) + (display-backtrace (make-stack #t) port) + (print-exception port + (stack-ref (make-stack #t) 1) + key args))) + (make-dump dump-archive + #:result %current-result + #:backtrace error-file) + (let ((report + ((installer-dump-page current-installer) + dump-archive))) + ((installer-exit-error current-installer) + error-file report key args))) + (primitive-exit 1))) + + ((installer-exit current-installer)))))) (program-file "installer" -- 2.34.0