From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QIPzLyjS4mEyxgAAgWs5BA (envelope-from ) for ; Sat, 15 Jan 2022 14:54:48 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id gGF4LSjS4mFycwAA9RJhRA (envelope-from ) for ; Sat, 15 Jan 2022 14:54:48 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 7100736187 for ; Sat, 15 Jan 2022 14:54:45 +0100 (CET) Received: from localhost ([::1]:44296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8jW0-0000x1-B0 for larch@yhetil.org; Sat, 15 Jan 2022 08:54:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8jTc-00066e-B1 for guix-patches@gnu.org; Sat, 15 Jan 2022 08:52:16 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8jTO-0004RA-Gs for guix-patches@gnu.org; Sat, 15 Jan 2022 08:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8jTO-0001uP-GQ for guix-patches@gnu.org; Sat, 15 Jan 2022 08:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53063] [PATCH v2 wip-harden-installer 01/18] 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: Sat, 15 Jan 2022 13:52: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: Mathieu Othacehe Cc: 53063@debbugs.gnu.org, ludo@gnu.org, Josselin Poiret Received: via spool by 53063-submit@debbugs.gnu.org id=B53063.16422546757230 (code B ref 53063); Sat, 15 Jan 2022 13:52:02 +0000 Received: (at 53063) by debbugs.gnu.org; 15 Jan 2022 13:51:15 +0000 Received: from localhost ([127.0.0.1]:39539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8jSc-0001sR-Fl for submit@debbugs.gnu.org; Sat, 15 Jan 2022 08:51:14 -0500 Received: from jpoiret.xyz ([206.189.101.64]:48200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8jRo-0001mJ-UT for 53063@debbugs.gnu.org; Sat, 15 Jan 2022 08:50:40 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id EA4E4184F7F; Sat, 15 Jan 2022 13:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1642254624; 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=EXrIB8GKWho+sga9HxKSHyb05zmKkfJYzJsBVJ+KlAELJ2xD0gY9vIRkQzgPpy5GS3CewW QaQbOQdSTsOaujJ0dYPBFrzqcMX8AXLI88xeoL6Bv6wP/WdsO6FWJ1YZlkDr0Nw/m8aPii M4zawsDkcL23oLZGsbE5MXOYliTeWmjcc6286sltX/uopoYEtbr1qMIEVu9Fvtkqgf0mjs 14RXd0JotvwoNH+8cM28iYydmtKCjSdauUX628LCR7xQqGaZTZ9tYeBER5hzWPRitJaSb5 uisMlnoRmZvT2R+19ClNtDIGbCOTLfILD46bhSPTxtAAUCxXx6ccSwwFXF85Sw== Date: Sat, 15 Jan 2022 14:49:54 +0100 Message-Id: <20220115135011.5817-2-dev@jpoiret.xyz> In-Reply-To: <20220115135011.5817-1-dev@jpoiret.xyz> References: <8735lz4xsv.fsf@gnu.org> <20220115135011.5817-1-dev@jpoiret.xyz> 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=1642254888; 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=IZWvZ2sX4H5/1kIn7KUgF/1/3UbtVlVi4QYjQXGtI+1JNx7UefUxj/zHGT6o2WU+AebzB7 Xxj/l1po2QVZeWr5NrAXVqcKS5JzRIduCF7TdXqjLN1oeiqjywlCTEm6SB9uVcqASbSUwz 4w4udp+Dn3BLtfQFssDXLOWHzQoDcGcjxWjguikeK4mopzhBNeDTQZpVgrUxF8PXlHO93c m0f/jNfZPjOxSJGmJ43gNMfCK8Mk3pZNEtvd1FHUDwKjfjjth9HSMSLqp/Pg/xiDyIc3Dq 9V7ySgaLjDWuCWw/2JgO3QSrWnfWLBFNvM8MiDjmygt068oxE0hm6gq+ulA4JA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642254888; a=rsa-sha256; cv=none; b=cXJKO/9wn+QfBLLqtLt/OsF8ONFYqjGgSm5Z9HJBQaKnUb10OsN1sZHolqak4tGi9Z+QM0 zKo0d8cBcW5lOoxXq3bez2biviTo4R7hDxtdNqvOs4oGqhFfkXwUfj1zaVUvTjE6/5PLUM 3mi5nOeU1VkKm9I1tKaVEesWhnb/JJsD7QwTPzVUkVFsb4q3o/xsOBP3fBHsGKnabj+v55 2T1bdWZvfJ4Oa9pluktkCYdFZaDyQ4QQxipz7LsVbw0CATSHGVwjUgWSC8WuKNFNU3e753 0d0XuFAz4ox/4g7ymn73BPD1JsSzcqk+6X4xuCsyHTte1aVv9ijenuP29jfunA== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=EXrIB8GK; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.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.13 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=EXrIB8GK; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.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: 7100736187 X-Spam-Score: -3.13 X-Migadu-Scanner: scn1.migadu.com X-TUID: nd1WDBBzyE82 * 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