all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20064: update-directory-autoloads and MD5 checksums
@ 2015-03-08 22:33 Sheda
  2016-07-29  0:57 ` npostavs
  0 siblings, 1 reply; 2+ messages in thread
From: Sheda @ 2015-03-08 22:33 UTC (permalink / raw
  To: 20064

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

Hi,

It seems that autoload.el's update-directory-autoloads fails when
instead of a time struct, an MD5 checksum is found in (nth 4 form).
Attached are both the .loaddefs.el that made me fall onto what looks
like a bug (the file was generated by el-get AFAIK) and a patch that
partially fix the problem (at least for me ;).

The following discussion helped me narrow down the problem:
  https://github.com/dimitri/el-get/issues/1352

Feedbacks of all kinds welcome.

Regards,

Sheda

[-- Attachment #2: autoload-md5.patch --]
[-- Type: text/x-patch, Size: 1145 bytes --]

--- autoload.el.orig	2015-03-08 23:10:06.623228668 +0100
+++ autoload.el	2015-03-08 23:23:24.203961615 +0100
@@ -713,6 +713,17 @@
   (search-forward generate-autoload-section-trailer)
   (delete-region begin (point)))
 
+(defun was-file-modified (md5-or-mtime file) 
+	(if (stringp md5-or-mtime)
+			; md5-or-mtime is an MD5 checksum.
+			(let ((last-md5 md5-or-mtime)
+						(file-md5 (md5 file))) 
+				(string= last-md5 file-md5))
+		; md5-or-mtime is a time structure.
+		(let ((last-time md5-or-mtime) 
+					(file-time (nth 5 (file-attriutes file)))) 
+			(not (time-less-p last-time file-time)))))
+
 ;;;###autoload
 (defun update-directory-autoloads (&rest dirs)
   "Update autoload definitions for Lisp files in the directories DIRS.
@@ -781,8 +792,7 @@
                        (member (expand-file-name file) autoload-excludes))
                    ;; Remove the obsolete section.
 		   (autoload-remove-section (match-beginning 0)))
-		  ((not (time-less-p (nth 4 form)
-                                     (nth 5 (file-attributes file))))
+		  ((was-file-modified (nth 4 form) file)
 		   ;; File hasn't changed.
 		   nil)
 		  (t

[-- Attachment #3: .loaddefs.el --]
[-- Type: text/x-emacs-lisp, Size: 6546 bytes --]

;;; .loaddefs.el --- automatically extracted autoloads
;;
;;; Code:

\f
;;;### (autoloads (el-get el-get-self-checksum el-get-checksum el-get-make-recipes
;;;;;;  el-get-cd el-get-reinstall el-get-remove el-get-self-update
;;;;;;  el-get-update-packages-of-type el-get-update-all el-get-update
;;;;;;  el-get-install el-get-version) "el-get/el-get" "../../../../../.emacs.d/el-get/el-get/el-get.el"
;;;;;;  "08fc70d24fc2dffafa39bf9f7869ccb5")
;;; Generated autoloads from ../../../../../.emacs.d/el-get/el-get/el-get.el

(autoload 'el-get-version "el-get/el-get" "\
Message the current el-get version

\(fn)" t nil)

(autoload 'el-get-install "el-get/el-get" "\
Cause the named PACKAGE to be installed after all of its
dependencies (if any).

PACKAGE may be either a string or the corresponding symbol.

\(fn PACKAGE)" t nil)

(autoload 'el-get-update "el-get/el-get" "\
Update PACKAGE.

\(fn PACKAGE)" t nil)

(autoload 'el-get-update-all "el-get/el-get" "\
Performs update of all installed packages.

\(fn &optional NO-PROMPT)" t nil)

(autoload 'el-get-update-packages-of-type "el-get/el-get" "\
Update all installed packages of type TYPE.

\(fn TYPE)" t nil)

(autoload 'el-get-self-update "el-get/el-get" "\
Update el-get itself.  The standard recipe takes care of reloading the code.

\(fn)" t nil)

(autoload 'el-get-remove "el-get/el-get" "\
Remove any PACKAGE that is know to be installed or required.

\(fn PACKAGE)" t nil)

(autoload 'el-get-reinstall "el-get/el-get" "\
Remove PACKAGE and then install it again.

\(fn PACKAGE)" t nil)

(autoload 'el-get-cd "el-get/el-get" "\
Open dired in the package directory.

\(fn PACKAGE)" t nil)

(autoload 'el-get-make-recipes "el-get/el-get" "\
Loop over `el-get-sources' and write a recipe file for each
entry which is not a symbol and is not already a known recipe.

\(fn &optional DIR)" t nil)

(autoload 'el-get-checksum "el-get/el-get" "\
Compute the checksum of the given package, and put it in the kill-ring

\(fn PACKAGE)" t nil)

(autoload 'el-get-self-checksum "el-get/el-get" "\
Compute the checksum of the running version of el-get itself.

Also put the checksum in the kill-ring.

\(fn)" t nil)

(autoload 'el-get "el-get/el-get" "\
Ensure that packages have been downloaded once and init them as needed.

This will not update the sources by using `apt-get install' or
`git pull', but it will ensure that:

* the packages have been installed
* load-path is set so their elisp files can be found
* Info-directory-list is set so their info files can be found
* Autoloads have been prepared and evaluated for each package
* Any post-installation setup (e.g. `(require 'feature)') happens

When SYNC is nil (the default), all installations run
concurrently, in the background.

When SYNC is 'sync, each package will be installed synchronously,
and any error will stop it all.

Please note that the `el-get-init' part of `el-get' is always
done synchronously. There's `byte-compile' support though, and
the packages you use are welcome to use `autoload' too.

PACKAGES is expected to be a list of packages you want to install
or init.  When PACKAGES is omited (the default), the list of
already installed packages is considered.

\(fn &optional SYNC &rest PACKAGES)" nil nil)

;;;***
\f
;;;### (autoloads (el-get-bundle! el-get-bundle el-get-bundle-el-get)
;;;;;;  "el-get/el-get-bundle" "../../../../../.emacs.d/el-get/el-get/el-get-bundle.el"
;;;;;;  "5d60bc715094fdbf95965c40aebf6111")
;;; Generated autoloads from ../../../../../.emacs.d/el-get/el-get/el-get-bundle.el

(autoload 'el-get-bundle-el-get "el-get/el-get-bundle" "\


\(fn SRC)" nil nil)

(autoload 'el-get-bundle "el-get/el-get-bundle" "\
Install PACKAGE and run initialization FORM.

PACKAGE can be either a simple package name or a package name
with a modifier before the name to specify local recipe source
information:

* `<owner>/' : specifies a Github owner name
* `gist:<id>' : specifies a Gist ID
* `<type>:' : specifies a type of the package source

If `FEATURE in PACKAGE' form is used instead of PACKAGE, then
that FEATURE is `require'd after installing PACKAGE.  You can
also use `el-get-bundle!' macro if FEATURE and PACKAGE are the
same.  If you wish to `require' more than one feature, then use
`:features' property in FORM.

The initialization FORM may start with a property list that
describes a local recipe.  The FORM after the property list is
treated as initialization code, which is actually an `:after'
property of the local recipe.

A copy of the initialization code is stored in a directory
specified by `el-get-bundle-init-directory' and its byte-compiled
version is used if `el-get-bundle-byte-compile' is non-nil.

\(fn PACKAGE &rest FORM)" nil t)

(put 'el-get-bundle 'lisp-indent-function 'defun)

(autoload 'el-get-bundle! "el-get/el-get-bundle" "\
Install PACKAGE and run initialization form.
It is the same as `el-get-bundle' except that PACKAGE is explicitly
required.

\(fn PACKAGE &rest ARGS)" nil t)

(put 'el-get-bundle! 'lisp-indent-function 'defun)

;;;***
\f
;;;### (autoloads (el-get-list-packages) "el-get/el-get-list-packages"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-list-packages.el"
;;;;;;  "07f410ec5bb8851a065841ab0d1b9875")
;;; Generated autoloads from ../../../../../.emacs.d/el-get/el-get/el-get-list-packages.el

(autoload 'el-get-list-packages "el-get/el-get-list-packages" "\
Display a list of packages.

\(fn)" t nil)

;;;***
\f
;;;### (autoloads nil nil ("../../../../../.emacs.d/el-get/el-get/el-get-autoloading.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-build.el" "../../../../../.emacs.d/el-get/el-get/el-get-bundle.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-byte-compile.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-core.el" "../../../../../.emacs.d/el-get/el-get/el-get-custom.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-dependencies.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-install.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-list-packages.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-methods.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-notify.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-recipes.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get-status.el"
;;;;;;  "../../../../../.emacs.d/el-get/el-get/el-get.el") (21753
;;;;;;  53887 292877 641000))

;;;***
\f
(provide '.loaddefs)
;; Local Variables:
;; version-control: never
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; .loaddefs.el ends here

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#20064: update-directory-autoloads and MD5 checksums
  2015-03-08 22:33 bug#20064: update-directory-autoloads and MD5 checksums Sheda
@ 2016-07-29  0:57 ` npostavs
  0 siblings, 0 replies; 2+ messages in thread
From: npostavs @ 2016-07-29  0:57 UTC (permalink / raw
  To: Sheda; +Cc: 20064

tags 20064 notabug
quit

Sheda <shedatc@gmail.com> writes:

> Hi,
>
> It seems that autoload.el's update-directory-autoloads fails when
> instead of a time struct, an MD5 checksum is found in (nth 4 form).
> Attached are both the .loaddefs.el that made me fall onto what looks
> like a bug (the file was generated by el-get AFAIK)

I think it's not a bug to throw an error in this case, it's just an
el-get bug that it generated such loaddefs files in the first place. (I
think the el-get bug was fixed, please followup on its issue tracker if
not).





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-29  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08 22:33 bug#20064: update-directory-autoloads and MD5 checksums Sheda
2016-07-29  0:57 ` npostavs

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.