From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: emacs18@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#7756: 24.0.50; enhancements to package.el Date: Wed, 29 Dec 2010 10:40:56 -0800 Message-ID: Reply-To: emacs18@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293648823 14875 80.91.229.12 (29 Dec 2010 18:53:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 29 Dec 2010 18:53:43 +0000 (UTC) To: 7756@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 29 19:53:38 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PY19R-00085n-6s for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Dec 2010 19:53:33 +0100 Original-Received: from localhost ([127.0.0.1]:56088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PY19Q-0006BC-RP for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Dec 2010 13:53:32 -0500 Original-Received: from [140.186.70.92] (port=59961 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PY19M-0006Ax-8l for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2010 13:53:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PY19K-0001Mn-NZ for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2010 13:53:28 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PY19K-0001Mj-Js for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2010 13:53:26 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PY0uQ-00009B-16; Wed, 29 Dec 2010 13:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Kim Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Dec 2010 18:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7756 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1293647865540 (code B ref -1); Wed, 29 Dec 2010 18:38:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Dec 2010 18:37:45 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PY0u9-00008e-FB for submit@debbugs.gnu.org; Wed, 29 Dec 2010 13:37:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PY0u7-00008T-A6 for submit@debbugs.gnu.org; Wed, 29 Dec 2010 13:37:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PY10i-0007qy-D2 for submit@debbugs.gnu.org; Wed, 29 Dec 2010 13:44:37 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:57224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PY10i-0007qu-7s for submit@debbugs.gnu.org; Wed, 29 Dec 2010 13:44:32 -0500 Original-Received: from [140.186.70.92] (port=47335 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PY0zG-0001kI-3Q for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2010 13:44:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PY0xN-0007N8-EC for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2010 13:41:06 -0500 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:43757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PY0xN-0007Mr-3y for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2010 13:41:05 -0500 Original-Received: by pzk27 with SMTP id 27so2515805pzk.0 for ; Wed, 29 Dec 2010 10:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:from:to:subject:reply-to :date:message-id:mime-version:content-type; bh=9zGKKIv5nkOxS/8vU+GI46PFaxYPDn9SgfMuCe0g13w=; b=u1q09ZxJmwB/2IdHypqZWw2dqCIiB5fE87IN2XsELBDl2rZdQIgLagtN1ekzU0Dw6M XTMrJ1s2ieX6D+teMB+byqRHZVPhkF/MVfCQsElHHfQqIu6PQYnU0Jq0TJzVsqFIsM6P zeeSJxx/izdtW0TgtWRq8LzG4LtF2bFx7gqoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:reply-to:date:message-id:mime-version:content-type; b=jFuDMOTg3d8s0o+RcxWr9DAvYzXHN5BKm//PN2ZfUB+b3weeP3/b6qRQvrv5/O+sTz kBDGO6FkjVKHo/qZv5PZ5TMdjTJw6i5BLOk1MeJ8EE+VMUX06+LUVrslVmxN3xPhFPS4 cbgc6P4c/IV9ixM26bLVwRWk8ebH7RIp8dIYk= Original-Received: by 10.142.217.10 with SMTP id p10mr12256702wfg.181.1293648063460; Wed, 29 Dec 2010 10:41:03 -0800 (PST) Original-Received: from dad-laptop (pool-96-225-218-44.ptldor.fios.verizon.net [96.225.218.44]) by mx.google.com with ESMTPS id v19sm21219636wfh.12.2010.12.29.10.41.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 29 Dec 2010 10:41:02 -0800 (PST) Original-From: Richard Kim X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 29 Dec 2010 13:38:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42920 Archived-At: I would like to suggest the following two sets of changes. The reason for the changes are explained in the diffs. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2010-11-10 21:35:06 +0000 +++ lisp/emacs-lisp/package.el 2010-12-29 18:38:08 +0000 @@ -338,9 +338,14 @@ (pkg-file (expand-file-name (concat (package-strip-version package) "-pkg") pkg-dir))) - (when (and (file-directory-p pkg-dir) - (file-exists-p (concat pkg-file ".el"))) - (load pkg-file nil t)))) + ;; When one is creating a package and testing it out, it is easy + ;; to forget to add the -pkg.el file. When that happens, it would + ;; be useful to provide feedback to the user rather than silently + ;; failing. That is what (error ...) below is for. + (when (file-directory-p pkg-dir) + (if (file-exists-p (concat pkg-file ".el")) + (load pkg-file nil t) + (error "'%s' file is missing!"))))) (defun package-load-all-descriptors () "Load descriptors for installed Emacs Lisp packages. @@ -569,8 +574,16 @@ (defun package-unpack (name version) (let ((pkg-dir (expand-file-name (concat (symbol-name name) "-" version) package-user-dir))) + ;; Delete the package directory if it exists already. This may + ;; not be useful to the end users. However this is extremely + ;; important for package developers as they experiment with which + ;; files to include in a package. If a file is removed from one + ;; iteration to the next, then the presence of the unwanted elisp + ;; file could cause problems by polluting the generated autoload + ;; file. + (if (file-directory-p pkg-dir) + (delete-directory pkg-dir 'recursive)) (make-directory package-user-dir t) - ;; FIXME: should we delete PKG-DIR if it exists? (let* ((default-directory (file-name-as-directory package-user-dir))) (package-untar-buffer) (package-generate-autoloads (symbol-name name) pkg-dir)