GNU bug report logs - #36919
[PATCH 0/2] Make the KDE updater find packaes in subdirectories

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Sun, 4 Aug 2019 10:27:02 UTC

Severity: normal

Tags: patch

Done: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 36919 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 36919 <at> debbugs.gnu.org
Subject: Re: [bug#36919] [PATCH 1/2] gnu-maintenance: KDE updater no longer
 relies on FTP access.
Date: Sun, 01 Sep 2019 21:43:51 +0200
Hi,

Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

>> How about moving this code to (guix import kde) as was done for (guix
>> import gnome) when we discussed it back then?  (See
>> <https://issues.guix.gnu.org/issue/28159>.)
>
> I'll be fine with this.
>
> I just wonder whether we/I should refactor the new code to be more
> flexible for other ls-lR cases and keep the common parts in
> gnu-maintenance.scm. OTOH currently there is no other use-case

Yeah, we’d have to identify what common parts exist.  On IRC we discussed
utility procedures like ‘file-sans-extension’, which would be worth
factorizing.

Other things may not be good candidates—for instance, the GNU thing is
probably close to what you’d write for KDE, but it’s still not exactly
the same.  Since there’s usually fine-tuning to be done, it may be best
to keep them separate.

> Am 17.08.19 um 23:01 schrieb Ludovic Courtès:
>> As a rule of thumb we don’t use ‘set!’ in Guix, except in special
>> circumstances.  In this case you can write:
>>
>>   (define (canonicalize-path path)
>>     (cond ((string-prefix? …)
>>            (string-drop path 17))
>>           ((string-suffix? …)
>>            (string-drop-right path 1))
>>           …))
>
> AFAIK, `cond` only processes the first expression where `test ` is true.
> In this case, we need to process *all* cases where the test is true.
> This means we need to nest the evaluation, which is ugly and hard to
> read IMHO. Is there some more "linear" syntax?

Oh I see.  You could roughly have one procedure for each clause and
chain them.  A macro might help make that more readable (Clojure has
‘->’).

HTH!

Ludo’.




This bug report was last modified 5 years and 251 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.