From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 2/4] emacs: Add 'guix-devel-download-package-source'. Date: Sat, 03 Oct 2015 22:35:57 +0200 Message-ID: <87d1wvadw2.fsf@gnu.org> References: <1443791046-1015-1-git-send-email-alezost@gmail.com> <1443791046-1015-3-git-send-email-alezost@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiTXF-0003zb-6N for guix-devel@gnu.org; Sat, 03 Oct 2015 16:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZiTXE-0001Ff-Dn for guix-devel@gnu.org; Sat, 03 Oct 2015 16:36:01 -0400 In-Reply-To: <1443791046-1015-3-git-send-email-alezost@gmail.com> (Alex Kost's message of "Fri, 2 Oct 2015 16:04:04 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Alex Kost Cc: guix-devel@gnu.org Alex Kost skribis: > * emacs/guix-devel.el (guix-devel-setup-repl): Use (guix packages) module. > (guix-devel-download-package-source): New command. > (guix-devel-keys-map): Add key binding for it. > * doc/emacs.texi (Emacs Development): Document it. [...] > +(defun guix-devel-download-package-source () > + "Download the source of the current package. > +Use this function to compute SHA256 hash of the package source." > + (interactive) > + (guix-devel-with-definition def > + (guix-devel-use-modules "(guix scripts download)") > + (when (or (not guix-operation-confirm) > + (y-or-n-p (format "Download '%s' package source?" def))) > + (guix-geiser-eval-in-repl > + (format "(guix-download (origin-uri (package-source %s)))" > + def))))) What about instead building the =E2=80=98package-source-derivation=E2=80=99= of the package? That way, that would do the exact same thing as =E2=80=98guix bui= ld -S=E2=80=99 and would work not only with =E2=80=98url-fetch=E2=80=99 but al= so with the other things. WDYT? Thanks, Ludo=E2=80=99.