GNU bug report logs - #28805
[PATCH] gnu: Add emacs-org-plus-contrib.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Fri, 13 Oct 2017 05:46:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


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

From: Christopher Baines <mail <at> cbaines.net>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 28805 <at> debbugs.gnu.org
Subject: Re: [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
Date: Sun, 15 Oct 2017 21:11:23 +0100
[Message part 1 (text/plain, inline)]
On Sun, 15 Oct 2017 21:44:29 +0200
ludo <at> gnu.org (Ludovic Courtès) wrote:

> > +(define-public emacs-org-contrib
> > +  (package
> > +    (inherit emacs-org)
> > +    (name "emacs-org-contrib")
> > +    (source (origin
> > +              (method url-fetch)
> > +              (uri (string-append "http://orgmode.org/elpa/org-plus-contrib-"
> > +                                  (package-version emacs-org) ".tar"))
> > +              (sha256
> > +               (base32
> > +                "1ya4kah8kg13ka3gpsw8hn6y8358843g986p1bgw5w77n9bgbwsl"))))
> > +    (arguments
> > +     `(#:phases
> > +       (modify-phases %standard-phases
> > +         (add-after 'install 'delete-org-files
> > +           (lambda* (#:key inputs outputs #:allow-other-keys)
> > +             (use-modules (ice-9 ftw))  
> 
> Please use #:modules instead of this inner ‘use-modules’ form (it has
> wacky semantic and could be deprecated in the future.)
> 
> > +             (let ((out (assoc-ref outputs "out")))
> > +               (for-each
> > +                (lambda (file)
> > +                  (if (and (not (string-prefix? "." file))
> > +                           (file-exists? file))
> > +                      (delete-file
> > +                       (string-append
> > +                        out
> > +                        "/share/emacs/site-lisp/guix.d/org-contrib-"
> > +                        ,(package-version emacs-org)
> > +                        "/"
> > +                        file))))
> > +                (scandir
> > +                 (string-append
> > +                  (assoc-ref inputs "emacs-org")
> > +                  "/share/emacs/site-lisp/guix.d/org-"
> > +                  ,(package-version emacs-org))))))))))  
> 
> For clarity, what about first buildign up the list of files to delete,
> and then actually deleting them?
> 
>   (let* (…
>          (org+contrib (map basename (find-files out)))
>          (org         (map basename (find-files org)))
>          (duplicates  (lset-intersection string=? org+contrib org)))
>     (with-directory-excursion (string-append out …)
>       (for-each delete-file duplicates))
>     #t)
> 
> WDYT?

That is nice :) I've attached an updated patch.
[0001-gnu-Add-emacs-org-contrib.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

This bug report was last modified 7 years and 281 days ago.

Previous Next


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