On Sun, 15 Oct 2017 21:44:29 +0200 ludo@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.