Message ID | 87ee9yuvnb.fsf@trop.in |
---|---|
State | Accepted |
Headers | show |
Andrew Tropin <andrew@trop.in> writes: […] > 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 <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(-) I did what you asked, but please, don't depend on recreating the branch next time. Otherwise we will wait for other contributers decision about this approach. Every branch recreation guix-commits mailing list receives a batch of messages, which could annoy subscribers. Thanks, Oleg.
On 2021-09-09 20:45, Oleg Pykhalov wrote: > Andrew Tropin <andrew@trop.in> writes: > > […] > >> 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 <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(-) > > I did what you asked, but please, don't depend on recreating the branch > next time. Otherwise we will wait for other contributers decision about > this approach. Every branch recreation guix-commits mailing list > receives a batch of messages, which could annoy subscribers. > > Thanks, > Oleg. Thank you! Didn't think about guix-commits ML, ok, will try to avoid this next time)
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