GNU bug report logs - #7756
24.0.50; enhancements to package.el

Previous Next

Package: emacs;

Reported by: emacs18 <at> gmail.com

Date: Wed, 29 Dec 2010 18:38:01 UTC

Severity: minor

Tags: patch

Found in version 24.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: emacs18 <at> gmail.com
Subject: bug#7756: closed (Re: bug#7756: 24.0.50; enhancements to package.el)
Date: Thu, 16 Jan 2020 23:50:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#7756: 24.0.50; enhancements to package.el

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 7756 <at> debbugs.gnu.org.

-- 
7756: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7756
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 7756-done <at> debbugs.gnu.org,
 Richard Kim <emacs18 <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#7756: 24.0.50; enhancements to package.el
Date: Fri, 17 Jan 2020 00:49:36 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> > I'm a bit uneasy about doing a recursive deletion of the directory, even
>> > after prompting (the developer may have put, well, anything in that
>> > directory), so I wonder whether the right fix here is to just remove the
>> > FIXME.
>>
>> FWIW, I'm fine with deleting the FIXME.  But I'm not a package
>> developer, so perhaps my opinion isn't worth much.
>
> Sounds good to me.  I'll go ahead and do that in a couple of days if I
> see no objections.

Now done on the master branch in commit f18c78e611.  I see nothing
more to do here, so I'm also closing this bug.

Best regards,
Stefan Kangas

[Message part 3 (message/rfc822, inline)]
From: emacs18 <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; enhancements to package.el
Date: Wed, 29 Dec 2010 10:40:56 -0800
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)




This bug report was last modified 5 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.