unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Tropin <andrew@trop.in>
To: Oleg Pykhalov <go.wigust@gmail.com>
Cc: 50296-done@debbugs.gnu.org
Subject: [bug#50296] [PATCH 0/2] Add 'guix home' command.
Date: Thu, 09 Sep 2021 09:10:16 +0300	[thread overview]
Message-ID: <87ee9yuvnb.fsf@trop.in> (raw)
In-Reply-To: <87pmtt8zh0.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1868 bytes --]

On 2021-08-31 17:23, Oleg Pykhalov wrote:

> Andrew Tropin <andrew@trop.in> 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 <andrew@trop.in>
>> 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 <andrew@trop.in>
>> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-fixup-home-services-run-on-change-Handle-first-gener.patch --]
[-- Type: text/x-patch, Size: 1963 bytes --]

From 6f3ec7f6bb4a6f495c4b7f38fce7cb31d179097b Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@trop.in>
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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2021-09-09  6:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  9:28 [bug#50296] [PATCH 0/2] Add 'guix home' command Andrew Tropin
     [not found] ` <handler.50296.B.16304022327647.ack@debbugs.gnu.org>
2021-08-31  9:40   ` [bug#50296] [PATCH 1/2] scripts: Add 'guix home' Andrew Tropin
2021-08-31 10:53     ` zimoun
2021-08-31 12:12       ` Andrew Tropin
2021-08-31 13:09         ` zimoun
2021-09-01  5:20           ` Andrew Tropin
2021-08-31  9:40   ` [bug#50296] [PATCH 2/2] scripts: home: Add import subcommand Andrew Tropin
2021-08-31 10:46 ` [bug#50296] [PATCH 0/2] Add 'guix home' command zimoun
2021-08-31 12:03   ` Andrew Tropin
2021-08-31 11:13 ` bug#50296: " Oleg Pykhalov
2021-08-31 11:46   ` [bug#50296] " Andrew Tropin
2021-08-31 12:47     ` Andrew Tropin
2021-08-31 14:23       ` Oleg Pykhalov
2021-09-01  5:36         ` Andrew Tropin
2021-09-09  6:10         ` Andrew Tropin [this message]
2021-09-09 17:45           ` Oleg Pykhalov
2021-09-10  5:31             ` Andrew Tropin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ee9yuvnb.fsf@trop.in \
    --to=andrew@trop.in \
    --cc=50296-done@debbugs.gnu.org \
    --cc=go.wigust@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).