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#7756: 24.0.50; enhancements to package.el Date: Thu, 30 Dec 2010 10:32:27 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293724421 10143 80.91.229.12 (30 Dec 2010 15:53:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2010 15:53:41 +0000 (UTC) Cc: 7756@debbugs.gnu.org To: emacs18@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 30 16:53:36 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 1PYKop-0005vG-NP for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 16:53:36 +0100 Original-Received: from localhost ([127.0.0.1]:45928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYKop-0008R5-86 for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 10:53:35 -0500 Original-Received: from [140.186.70.92] (port=56917 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYKok-0008Qz-TY for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2010 10:53:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYKoj-0006Lz-0h for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2010 10:53:30 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYKoi-0006Lu-SC for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2010 10:53:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PYKO9-0002Xp-OG; Thu, 30 Dec 2010 10:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Dec 2010 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7756 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7756-submit@debbugs.gnu.org id=B7756.12937227469761 (code B ref 7756); Thu, 30 Dec 2010 15:26:01 +0000 Original-Received: (at 7756) by debbugs.gnu.org; 30 Dec 2010 15:25:46 +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 1PYKNu-0002XO-Bb for submit@debbugs.gnu.org; Thu, 30 Dec 2010 10:25:46 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PYKNs-0002X9-3x for 7756@debbugs.gnu.org; Thu, 30 Dec 2010 10:25:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoAFADc1HE1FpZcL/2dsb2JhbACWH44bdL53hUoEhGWOGw X-IronPort-AV: E=Sophos;i="4.60,249,1291611600"; d="scan'208";a="86791929" Original-Received: from 69-165-151-11.dsl.teksavvy.com (HELO pastel.home) ([69.165.151.11]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 30 Dec 2010 10:32:28 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 88FDE5934F; Thu, 30 Dec 2010 10:32:27 -0500 (EST) In-Reply-To: (emacs's message of "Wed, 29 Dec 2010 10:40:56 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 30 Dec 2010 10:26:01 -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:42934 Archived-At: > @@ -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!"))))) I agree with the intention, but I wonder: why do we pass the `noerror' parameter to `load' in the first place? > @@ -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)) Here, I also agree with the intention, but I'm a little uneasy blindly removing a whole subdirectory without warning: I'd add a confirmation prompt. Stefan