From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#18332: 24.3.93; Convenience is a malformed function when installing ELPA package Date: Tue, 02 Sep 2014 15:53:20 -0400 Message-ID: References: <86ppfnoed8.fsf@somewhere.org> <5a61hfdyfp.fsf@fencepost.gnu.org> <8661hbm2nl.fsf@somewhere.org> <86r3zunxfo.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409687728 7176 80.91.229.3 (2 Sep 2014 19:55:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Sep 2014 19:55:28 +0000 (UTC) Cc: Fabrice Niessen , 18332@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 02 21:55:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XOuAh-0006j0-Tz for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Sep 2014 21:55:20 +0200 Original-Received: from localhost ([::1]:39972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOuAh-00063b-2h for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Sep 2014 15:55:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOuAX-0005zh-QY for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 15:55:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOuAR-0003er-AK for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 15:55:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOuAR-0003eb-8D for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 15:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XOuAQ-0000aP-M8 for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 15:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Sep 2014 19:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18332 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18332-submit@debbugs.gnu.org id=B18332.14096876422170 (code B ref 18332); Tue, 02 Sep 2014 19:55:02 +0000 Original-Received: (at 18332) by debbugs.gnu.org; 2 Sep 2014 19:54:02 +0000 Original-Received: from localhost ([127.0.0.1]:57135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOu9O-0000Yd-Ah for submit@debbugs.gnu.org; Tue, 02 Sep 2014 15:54:02 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:47837) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOu9I-0000YR-J3 for 18332@debbugs.gnu.org; Tue, 02 Sep 2014 15:53:56 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 996BF84F43; Tue, 2 Sep 2014 15:53:50 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 5B2011E5B8A; Tue, 2 Sep 2014 15:53:20 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 35F89B4171; Tue, 2 Sep 2014 15:53:20 -0400 (EDT) In-Reply-To: (Glenn Morris's message of "Tue, 02 Sep 2014 12:57:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92973 Archived-At: > rm -rf /tmp/foo > mkdir -p /tmp/foo > HOME=/tmp/foo emacs-24.3.93 -l package \ > --eval "(progn (package-initialize) (package-refresh-contents) (package-install 'yasnippet))" > However I just get a byte-compilation warning, no error. Don't know about the error, indeed. I've fixed the two problems I saw in the above test (first problem: the yasnippet-pkg.el file was re-generated rather than just using the one that's in the tarball; second problem: the file we generated did not properly quote the arguments, hence the compilation warning). Stefan === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-02 18:16:32 +0000 +++ lisp/ChangeLog 2014-09-02 19:49:58 +0000 @@ -1,5 +1,13 @@ 2014-09-02 Stefan Monnier + * emacs-lisp/package.el (package-generate-description-file): + Properly quote the arguments (bug#18332). Change second arg. + (package--alist-to-plist-args): Rename from package--alist-to-plist and + quote the elements. + (package--make-autoloads-and-stuff): Fix the test for pre-existence of + the *-pkg.el file. Adjust to new calling convention of + package-generate-description-file. + * progmodes/gud.el (gud-gdb-completion-at-point): Add hack (bug#18282). (gud-gdb-completions): Remove obsolete workaround. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-06-26 13:47:37 +0000 +++ lisp/emacs-lisp/package.el 2014-09-02 19:46:57 +0000 @@ -688,11 +688,9 @@ (error "Package does not untar cleanly into directory %s/" dir))))) (tar-untar-buffer)) -(defun package-generate-description-file (pkg-desc pkg-dir) +(defun package-generate-description-file (pkg-desc pkg-file) "Create the foo-pkg.el file for single-file packages." - (let* ((name (package-desc-name pkg-desc)) - (pkg-file (expand-file-name (package--description-file pkg-dir) - pkg-dir))) + (let* ((name (package-desc-name pkg-desc))) (let ((print-level nil) (print-quoted t) (print-length nil)) @@ -712,13 +710,20 @@ (list (car elt) (package-version-join (cadr elt)))) requires)))) - (package--alist-to-plist + (package--alist-to-plist-args (package-desc-extras pkg-desc)))) "\n") nil pkg-file nil 'silent)))) -(defun package--alist-to-plist (alist) - (apply #'nconc (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist))) +(defun package--alist-to-plist-args (alist) + (mapcar (lambda (x) + (if (and (not (consp x)) + (or (keywordp x) + (not (symbolp x)) + (memq x '(nil t)))) + x `',x)) + (apply #'nconc + (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist)))) (defun package-unpack (pkg-desc) "Install the contents of the current buffer as a package." @@ -751,9 +756,10 @@ (defun package--make-autoloads-and-stuff (pkg-desc pkg-dir) "Generate autoloads, description file, etc.. for PKG-DESC installed at PKG-DIR." (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir) - (let ((desc-file (package--description-file pkg-dir))) + (let ((desc-file (expand-file-name (package--description-file pkg-dir) + pkg-dir))) (unless (file-exists-p desc-file) - (package-generate-description-file pkg-desc pkg-dir))) + (package-generate-description-file pkg-desc desc-file))) ;; FIXME: Create foo.info and dir file from foo.texi? )