From patchwork Sun Feb 27 13:53:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37523 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 69FDD27BBEA; Sun, 27 Feb 2022 14:07:35 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 12C7C27BBE9 for ; Sun, 27 Feb 2022 14:07:35 +0000 (GMT) Received: from localhost ([::1]:49422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOKD0-0000z5-8I for patchwork@mira.cbaines.net; Sun, 27 Feb 2022 09:07:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOK10-0000Xd-0O for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOK0x-0001tZ-0H for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOK0w-0004up-Ux for guix-patches@gnu.org; Sun, 27 Feb 2022 08:55:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54180] [PATCH 04/12] home: symlink-manager: Use 'file-is-directory?'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 13:55:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54180@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 54180-submit@debbugs.gnu.org id=B54180.164597007018768 (code B ref 54180); Sun, 27 Feb 2022 13:55:06 +0000 Received: (at 54180) by debbugs.gnu.org; 27 Feb 2022 13:54:30 +0000 Received: from localhost ([127.0.0.1]:57178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOK0M-0004sY-Cb for submit@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOK0A-0004qG-Pn for 54180@debbugs.gnu.org; Sun, 27 Feb 2022 08:54:23 -0500 Received: from [2001:470:142:3::e] (port=50234 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOJzu-0001ZT-Fp; Sun, 27 Feb 2022 08:54:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Iu6fW84CZKtG3DrzzEXHBBf/kxZvuu3PydhwG5xiicQ=; b=Difn/DnBQW8tY8Rs877v dOwBCzxQnzkpyA+qKWlmfjQhY/NRX8V8EiunXft4s4mCoAhCCuNHJ8dkLO87j8HotqfKlSN8jLbVd AV9HcDmo+F4toy3Iv2w0/mWAP4peTMZ2BlJDLap1CcDlyp1BUy/tou/3QgA4INgEsgLLKRNQkelZK ptrdykxIDayO4jKbK+CpMv/aZl5fvBGTLMVPoxixVSNpcjetp0mdReZlJxTuf8lFqtVfn5uX+nWHK OepMaj7M44YtvfjrSYe4uidcv5tmiS9/FHUjVKRyD4oe79d87cDJK6RY+y9cn63YJX01beQxLMy8+ EIiCXNSqCb2N8w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55804 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOJzs-0007Pg-SH; Sun, 27 Feb 2022 08:54:02 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sun, 27 Feb 2022 14:53:34 +0100 Message-Id: <20220227135342.10296-4-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220227135342.10296-1-ludo@gnu.org> References: <20220227135342.10296-1-ludo@gnu.org> MIME-Version: 1.0 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 * gnu/home/services/symlink-manager.scm (update-symlinks-script)[directory?]: Remove. Change callers to use 'file-is-directory?' instead. --- gnu/home/services/symlink-manager.scm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm index a6344c808f..f133eb17f2 100644 --- a/gnu/home/services/symlink-manager.scm +++ b/gnu/home/services/symlink-manager.scm @@ -101,9 +101,6 @@ (define (get-target-path path) (define (get-backup-path path) (string-append backup-dir "/." path)) - (define (directory? path) - (equal? (stat:type (stat path)) 'directory)) - (define (empty-directory? dir) (equal? (scandir dir) '("." ".."))) @@ -133,7 +130,7 @@ (define (cleanup-symlinks old-tree) (('dir . path) (if (and (file-exists? (get-target-path path)) - (directory? (get-target-path path)) + (file-is-directory? (get-target-path path)) (empty-directory? (get-target-path path))) (begin (format #t (G_ "Removing ~a...") @@ -179,7 +176,7 @@ (define (get-source-path path) (('dir . path) (let ((target-path (get-target-path path))) (when (and (file-exists? target-path) - (not (directory? target-path))) + (not (file-is-directory? target-path))) (backup-file path)) (if (file-exists? target-path)