From patchwork Tue Jan 19 18:42:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 26505 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 92DD227BC15; Tue, 19 Jan 2021 19:29:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 74B3027BC14 for ; Tue, 19 Jan 2021 19:29:27 +0000 (GMT) Received: from localhost ([::1]:51970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1wgw-0003Xf-FO for patchwork@mira.cbaines.net; Tue, 19 Jan 2021 14:29:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vy2-0007CU-KK for guix-patches@gnu.org; Tue, 19 Jan 2021 13:43:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1vy2-0002K0-BF for guix-patches@gnu.org; Tue, 19 Jan 2021 13:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l1vy2-00082p-7v for guix-patches@gnu.org; Tue, 19 Jan 2021 13:43:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45991] [PATCH core-updates] Move 'mkdir-p/perms' to gnu/build/utils.scm Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Jan 2021 18:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45991 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45991@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161108175730884 (code B ref -1); Tue, 19 Jan 2021 18:43:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jan 2021 18:42:37 +0000 Received: from localhost ([127.0.0.1]:51728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1vxc-000823-NV for submit@debbugs.gnu.org; Tue, 19 Jan 2021 13:42:37 -0500 Received: from lists.gnu.org ([209.51.188.17]:36946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1vxX-00081o-S1 for submit@debbugs.gnu.org; Tue, 19 Jan 2021 13:42:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vxX-0006zr-Hc for guix-patches@gnu.org; Tue, 19 Jan 2021 13:42:31 -0500 Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]:41974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1vxS-0002DA-Lf for guix-patches@gnu.org; Tue, 19 Jan 2021 13:42:31 -0500 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id JiiN2400R0mfAB406iiPmf; Tue, 19 Jan 2021 19:42:23 +0100 Message-ID: <8dda4413505b28fedb9588a4064812fe69c19a37.camel@telenet.be> From: Maxime Devos Date: Tue, 19 Jan 2021 19:42:11 +0100 User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Guix, This is the patch I talked about on IRC. It moves the various inline definitions of 'mkdir-p/perms' from gnu/services/... to gnu/build/utils.scm. I've also written a few tests. As this change entails a world rebuild, this should be applied to core-updates instead of master (as civodul pointed out). `make check TESTS=tests/build-utils.scm` succeeds. Building a few packages for testing will take some time though (due to the world rebuild). Plenty of parentheses, Maxime From 6ebc5f9e390af1d2efaee1c6640724b358434029 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 19 Jan 2021 19:19:54 +0100 Subject: [PATCH 2/2] gnu: remove inline 'mkdir-p/perms' definitions * gnu/services/mail.scm (%dovecot-activation): Leave this anomalous definition for someone else to figure out. * gnu/services/dns.scm (%knot-activation): Remove inline definition of 'mkdir-p/perms'. * gnu/services/cups.scm (%cups-activation): Likewise. --- gnu/services/cups.scm | 4 ---- gnu/services/dns.scm | 4 ---- gnu/services/mail.scm | 13 ++++++++----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm index 17ed04e58b..5099bbe421 100644 --- a/gnu/services/cups.scm +++ b/gnu/services/cups.scm @@ -874,10 +874,6 @@ IPP specifications.") (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) - (define (mkdir-p/perms directory owner perms) - (mkdir-p directory) - (chown directory (passwd:uid owner) (passwd:gid owner)) - (chmod directory perms)) (define (build-subject parameters) (string-concatenate (map (lambda (pair) diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index b339eb0619..cf8e9dac7f 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -609,10 +609,6 @@ (define (knot-activation config) #~(begin (use-modules (guix build utils)) - (define (mkdir-p/perms directory owner perms) - (mkdir-p directory) - (chown directory (passwd:uid owner) (passwd:gid owner)) - (chmod directory perms)) (mkdir-p/perms #$(knot-configuration-run-directory config) (getpwnam "knot") #o755) (mkdir-p/perms "/var/lib/knot" (getpwnam "knot") #o755) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index c0f6371104..e17be3197c 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1484,7 +1484,10 @@ greyed out, instead of only later giving \"not selectable\" popup error. dovecot-configuration-fields))))))) #~(begin (use-modules (guix build utils)) - (define (mkdir-p/perms directory owner perms) + ;; XXX someone please take a look + ;; if the hardcoding of /var/run/dovecot + ;; is intended, or a bug. idk + (define (mkdir-p/perms-xxx directory owner perms) (mkdir-p directory) (chown "/var/run/dovecot" (passwd:uid owner) (passwd:gid owner)) (chmod directory perms)) @@ -1529,12 +1532,12 @@ greyed out, instead of only later giving \"not selectable\" popup error. (format (current-error-port) "Failed to create public key at ~a.\n" public-key))))) (let ((user (getpwnam "dovecot"))) - (mkdir-p/perms "/var/run/dovecot" user #o755) - (mkdir-p/perms "/var/lib/dovecot" user #o755) - (mkdir-p/perms "/etc/dovecot" user #o755) + (mkdir-p/perms-xxx "/var/run/dovecot" user #o755) + (mkdir-p/perms-xxx "/var/lib/dovecot" user #o755) + (mkdir-p/perms-xxx "/etc/dovecot" user #o755) (copy-file #$(plain-file "dovecot.conf" config-str) "/etc/dovecot/dovecot.conf") - (mkdir-p/perms "/etc/dovecot/private" user #o700) + (mkdir-p/perms-xxx "/etc/dovecot/private" user #o700) (create-self-signed-certificate-if-absent #:private-key "/etc/dovecot/private/default.pem" #:public-key "/etc/dovecot/default.pem" -- 2.30.0