From: Rob Browning Date: Sat, 7 Nov 2020 21:05:52 +0000 (-0600) Subject: Strip parent path from package descriptions for reproducibility X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~124^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a64353ba297f114e47c5e22d4a522d95bd400b58;p=emacs.git Strip parent path from package descriptions for reproducibility Previously, the package description would include the full build tree path which varies. Instead, remove any duplicate slashes and any components other than the immediate parent. Thanks to Chris Lamb for reporting the problem and tracking down the cause. Bug-Debian: https://bugs.debian.org/972861 --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7d6be3cf4e2..60561fdb678 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -963,7 +963,11 @@ untar into a directory named DIR; otherwise, signal an error." (write-region (concat ";;; Generated package description from " - (replace-regexp-in-string "-pkg\\.el\\'" ".el" pkg-file) + (replace-regexp-in-string ;; just the final y.el or x/y.el + "^.*?\\([^/]+/\\)?\\([^/]+\\)$" "\\1\\2" + (replace-regexp-in-string + "/+" "/" + (replace-regexp-in-string "-pkg\\.el\\'" ".el" pkg-file))) " -*- no-byte-compile: t -*-\n" (prin1-to-string (nconc