From patchwork Thu Sep 9 06:10:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 32722 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 DAB0027BBE3; Thu, 9 Sep 2021 07:11:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, 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 5EB8027BBE1 for ; Thu, 9 Sep 2021 07:11:28 +0100 (BST) Received: from localhost ([::1]:60202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mODHT-0005Ev-B5 for patchwork@mira.cbaines.net; Thu, 09 Sep 2021 02:11:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mODH4-0005DY-9f for guix-patches@gnu.org; Thu, 09 Sep 2021 02:11:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mODH4-0001Ud-1e for guix-patches@gnu.org; Thu, 09 Sep 2021 02:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mODH3-0000eq-Tp for guix-patches@gnu.org; Thu, 09 Sep 2021 02:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50296] [PATCH 0/2] Add 'guix home' command. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Sep 2021 06:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50296 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Oleg Pykhalov Cc: 50296-done@debbugs.gnu.org Received: via spool by 50296-done@debbugs.gnu.org id=D50296.16311678312487 (code D ref 50296); Thu, 09 Sep 2021 06:11:01 +0000 Received: (at 50296-done) by debbugs.gnu.org; 9 Sep 2021 06:10:31 +0000 Received: from localhost ([127.0.0.1]:33978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mODGZ-0000e2-Ew for submit@debbugs.gnu.org; Thu, 09 Sep 2021 02:10:31 -0400 Received: from mail-lj1-f175.google.com ([209.85.208.175]:33308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mODGU-0000do-V4 for 50296-done@debbugs.gnu.org; Thu, 09 Sep 2021 02:10:30 -0400 Received: by mail-lj1-f175.google.com with SMTP id s12so1274051ljg.0 for <50296-done@debbugs.gnu.org>; Wed, 08 Sep 2021 23:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=G4lVm6d+fnL42OXBeV7kHmCdKtzrpx7KSZFgMxuIMeM=; b=KBwyo2CY/ngS2nctG5OHqNvwdP/x2AXvRpuaRyZCEllRL+Lxz6G8Jc4RhNt/lOQ2Ch CoCu+jAp6f7EKuhBj4Quj4uND2nQKSwj6khi5zY/xtp8jRDYV9KuDRAQB4s7Pyjcw/3R 8BAvAdWui3Pjo3/xaoXOeuTztUO0ZpIYl9hspbepHJ6JkjbDKoWdw7e3v/Uv1YdBXN1h tGAPIH/G5Lbpy8Sop87lO64eA+bgArKarLLuoD/7pPhMumbuMVuP5mRF6FYEzSEHFH54 d4OISKhSk1vQM1EPkl++rIBa0/S5v5MCklvaa/7GUARy+nBpVGZtRfXApM0sowCYsOAF sQJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=G4lVm6d+fnL42OXBeV7kHmCdKtzrpx7KSZFgMxuIMeM=; b=EzOyJ4cCJpDfRumxqmQDEbjaxuc1CVl6xnJLULr+CrmzJiXwVe6pDlgrTtnNxE6Ots B5hOk6oZkZdGdRBsnTg679CWEvnW1M2TanFY5Fg9xaGlwsddd8UGPm7eDsWdZIROJRIZ nisFLBY/yIYAKwCHhb36I91Y1+a8SSneqhMBEiO2ZIFw8JESL6sQ+jiVVAzRHMiY8+Xq u92QorNqASRH9thELPihwuOa+qZpFWy9xJXz1dYCoehUX+qKmXYu2XZ1BUXTRUR/Hdp2 VpskBiCXnEWTkKJ1gMUO7W3W21xY/nQUaSNeJqZ8IHDefdoyyRx8hNeMxuP9U+FmMh/l uw8Q== X-Gm-Message-State: AOAM532RyyM10N4WKdKd+UUjZTLIEvT59uuKarT0o/Vr+MKst3TbJoHK ryV1koDVzwR4xfYf0QPbNU1nSQ== X-Google-Smtp-Source: ABdhPJzgD+P/LeShP3Q3c1962kvW24q2Ypv2KT2m8a6IUlnCVlZwY33eunFR5W8iTKuSWOi+EpI7/g== X-Received: by 2002:a2e:a486:: with SMTP id h6mr975141lji.208.1631167820818; Wed, 08 Sep 2021 23:10:20 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id m5sm90795lfk.267.2021.09.08.23.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 23:10:19 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87pmtt8zh0.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> <87eea9ixx4.fsf@trop.in> <87pmtt8zh0.fsf@gmail.com> Date: Thu, 09 Sep 2021 09:10:16 +0300 Message-ID: <87ee9yuvnb.fsf@trop.in> 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 On 2021-08-31 17:23, Oleg Pykhalov wrote: > Andrew Tropin writes: > > […] > >> The functions from home-services-utils used by xdg now in home-services >> utils: >> >> From efd3ea79905c12e2c1c594fa6b54cf62d741f92f Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 31 Aug 2021 15:40:07 +0300 >> Subject: [PATCH 2/2] home-services: configuration: Add >> generic-serialize-alist. >> >> * gnu/home-services/configuration.scm (generic-serialize-alist) >> (generic-serialize-alist-entry): New variables. > > As you said, no variables, but functions ;-) > > Also, we could join those functions in Git commit message with comma. > > Applied with changes above. > > […] > >>> run-on-change service doesn't handle the case, where the previous >>> generation doesn't exists. Fix should be pretty simple, will send a >>> patch once it done. Thank you for catching this) >>> >> >> The fix: >> >> From a07541380d412b33c504e5811776062af4e38582 Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 31 Aug 2021 15:24:25 +0300 >> Subject: [PATCH 1/2] home-services: run-on-change: Handle first generation >> case. >> >> --- >> gnu/home-services.scm | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) > > […] > > Added Git changelog-like line. > > Applied. > > Pushed to wip-guix-home as 0c7bb26435513a61814d98af1c790e43a74afb6e. > > Oleg. I did a little better solution for the first generation case for on-change service. Added it as fixup commit, so it's necessary to rebase with --autosquash to get it melded in the right place. Can you also rebase the whole branch on the latest master and recreate it, please? I'll test it and will be preparing for merge. Probably will send a few more patches, but they should be minor. From 6f3ec7f6bb4a6f495c4b7f38fce7cb31d179097b Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Wed, 8 Sep 2021 08:15:35 +0300 Subject: [PATCH] fixup! home-services: run-on-change: Handle first generation case. --- gnu/home-services.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 5608c65175..9f1e986616 100644 --- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -439,7 +439,10 @@ with one gexp, but many times, and all gexps must be idempotent."))) (define expressions-to-eval (map (lambda (x) - (let* ((file1 (string-append (getenv "GUIX_OLD_HOME") "/" (car x))) + (let* ((file1 (string-append + (or (getenv "GUIX_OLD_HOME") + "/gnu/store/non-existing-generation") + "/" (car x))) (file2 (string-append (getenv "GUIX_NEW_HOME") "/" (car x))) (_ (format #t "Comparing ~a and\n~10t~a..." file1 file2)) (any-changes? (something-changed? file1 file2)) @@ -448,14 +451,14 @@ with one gexp, but many times, and all gexps must be idempotent."))) (if any-changes? (cadr x) ""))) '#$pattern-gexp-tuples)) - (if (and #$eval-gexps? (getenv "GUIX_OLD_HOME")) + (if #$eval-gexps? (begin (display "Evaling on-change gexps.\n\n") (for-each primitive-eval expressions-to-eval) (display "On-change gexps evaluation finished.\n\n")) (display "\ -On-change gexps won't evaluated, disabled by service configuration or -there are no previos generations.\n")))) +On-change gexps won't be evaluated, disabled by service +configuration.\n")))) (define home-run-on-change-service-type (service-type (name 'home-run-on-change) -- 2.33.0