mirror of
git://slackware.nl/current.git
synced 2025-02-04 20:46:11 +01:00
a36b32349b
ap/moc-2.5.2-x86_64-5.txz: Rebuilt. Patched and recompiled against ffmpeg-4.1.4. Thanks to Heinz Wiesinger. ap/vim-8.1.1710-x86_64-1.txz: Upgraded. d/cmake-3.15.0-x86_64-1.txz: Upgraded. e/emacs-26.2-x86_64-2.txz: Rebuilt. Patched package.el to obey buffer-file-coding-system (bug #35739), fixing bad signature from GNU ELPA for archive-contents. Thanks to Stefan Monnier and Eric Lindblad. kde/k3b-2.0.3-x86_64-5.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. kde/kfilemetadata-4.14.3-x86_64-5.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. kde/nepomuk-core-4.14.3-x86_64-5.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. l/alsa-plugins-1.1.9-x86_64-2.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. l/ffmpeg-4.1.4-x86_64-1.txz: Upgraded. Shared library .so-version bump. l/gegl-0.4.16-x86_64-2.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. l/gst-plugins-libav-1.16.0-x86_64-2.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. l/gvfs-1.40.2-x86_64-1.txz: Upgraded. l/imagemagick-6.9.10_54-x86_64-1.txz: Upgraded. l/libvisual-plugins-0.4.0-x86_64-4.txz: Rebuilt. Patched to fix a segmentation fault while loading plugin file. Thanks to alienBOB. l/libvpx-1.8.1-x86_64-1.txz: Upgraded. n/curl-7.65.2-x86_64-1.txz: Upgraded. xap/MPlayer-20190717-x86_64-1.txz: Upgraded. Compiled against ffmpeg-4.1.4. xap/audacious-plugins-3.10.1-x86_64-3.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. xap/vim-gvim-8.1.1710-x86_64-1.txz: Upgraded. xap/xine-lib-1.2.9-x86_64-5.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. extra/pure-alsa-system/MPlayer-20190717-x86_64-1_alsa.txz: Upgraded. Compiled against ffmpeg-4.1.4. extra/pure-alsa-system/alsa-plugins-1.1.9-x86_64-2_alsa.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. extra/pure-alsa-system/audacious-plugins-3.10.1-x86_64-3_alsa.txz: Rebuilt. Recompiled against ffmpeg-4.1.4. extra/pure-alsa-system/ffmpeg-4.1.4-x86_64-1_alsa.txz: Upgraded. Shared library .so-version bump. extra/pure-alsa-system/xine-lib-1.2.9-x86_64-5_alsa.txz: Rebuilt. Recompiled against ffmpeg-4.1.4.
114 lines
5.2 KiB
Diff
114 lines
5.2 KiB
Diff
From b3df3729596332a39404c364798a61bfef2adcc2 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Monnier <monnier@iro.umontreal.ca>
|
|
Date: Fri, 31 May 2019 00:54:05 -0400
|
|
Subject: * lisp/emacs-lisp/package.el: Obey buffer-file-coding-system
|
|
(bug#35739)
|
|
|
|
`url-insert-file-contents` saves in buffer-file-coding-system
|
|
the coding-system used to decode the contents. Preserve this
|
|
as the contents is moved from buffer to string to buffer, and use
|
|
it when saving the contents to file, so as to try and better preserve
|
|
the original byte sequence.
|
|
|
|
(package--buffer-string, package--cs): New functions.
|
|
(package--check-signature): Encode `string` if a coding-system
|
|
was specified in buffer-file-coding-system.
|
|
(package--download-one-archive, package-install-from-archive):
|
|
Obey and preserve the buffer-file-coding-system if specified.
|
|
|
|
Do not merge.
|
|
---
|
|
lisp/emacs-lisp/package.el | 36 +++++++++++++++++++++++++++---------
|
|
1 file changed, 27 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
|
|
index 1a185de..46f7c91 100644
|
|
--- a/lisp/emacs-lisp/package.el
|
|
+++ b/lisp/emacs-lisp/package.el
|
|
@@ -1241,6 +1241,17 @@ errors."
|
|
(signal 'bad-signature (list sig-file)))
|
|
good-signatures)))
|
|
|
|
+(defun package--buffer-string ()
|
|
+ (let ((string (buffer-string)))
|
|
+ (when (and buffer-file-coding-system
|
|
+ (> (length string) 0))
|
|
+ (put-text-property 0 1 'package--cs buffer-file-coding-system string))
|
|
+ string))
|
|
+
|
|
+(defun package--cs (string)
|
|
+ (and (> (length string) 0)
|
|
+ (get-text-property 0 'package--cs string)))
|
|
+
|
|
(defun package--check-signature (location file &optional string async callback unwind)
|
|
"Check signature of the current buffer.
|
|
Download the signature file from LOCATION by appending \".sig\"
|
|
@@ -1260,8 +1271,12 @@ Otherwise, an error is signaled.
|
|
|
|
UNWIND, if provided, is a function to be called after everything
|
|
else, even if an error is signaled."
|
|
- (let ((sig-file (concat file ".sig"))
|
|
- (string (or string (buffer-string))))
|
|
+ (let* ((sig-file (concat file ".sig"))
|
|
+ (string (or string (package--buffer-string)))
|
|
+ (cs (package--cs string)))
|
|
+ ;; Re-encode the downloaded file with the coding-system with which
|
|
+ ;; it was decoded, so we (hopefully) get the exact same bytes back.
|
|
+ (when cs (setq string (encode-coding-string string cs)))
|
|
(package--with-response-buffer location :file sig-file
|
|
:async async :noerror t
|
|
;; Connection error is assumed to mean "no sig-file".
|
|
@@ -1529,7 +1544,7 @@ similar to an entry in `package-alist'. Save the cached copy to
|
|
:error-form (package--update-downloads-in-progress archive)
|
|
(let* ((location (cdr archive))
|
|
(name (car archive))
|
|
- (content (buffer-string))
|
|
+ (content (package--buffer-string))
|
|
(dir (expand-file-name (format "archives/%s" name) package-user-dir))
|
|
(local-file (expand-file-name file dir)))
|
|
(when (listp (read content))
|
|
@@ -1538,7 +1553,8 @@ similar to an entry in `package-alist'. Save the cached copy to
|
|
(member name package-unsigned-archives))
|
|
;; If we don't care about the signature, save the file and
|
|
;; we're done.
|
|
- (progn (let ((coding-system-for-write 'utf-8))
|
|
+ (progn (let ((coding-system-for-write
|
|
+ (or (package--cs content) 'utf-8)))
|
|
(write-region content nil local-file nil 'silent))
|
|
(package--update-downloads-in-progress archive))
|
|
;; If we care, check it (perhaps async) and *then* write the file.
|
|
@@ -1546,7 +1562,7 @@ similar to an entry in `package-alist'. Save the cached copy to
|
|
location file content async
|
|
;; This function will be called after signature checking.
|
|
(lambda (&optional good-sigs)
|
|
- (let ((coding-system-for-write 'utf-8))
|
|
+ (let ((coding-system-for-write (or (package--cs content) 'utf-8)))
|
|
(write-region content nil local-file nil 'silent))
|
|
;; Write out good signatures into archive-contents.signed file.
|
|
(when good-sigs
|
|
@@ -1838,15 +1854,17 @@ if all the in-between dependencies are also in PACKAGE-LIST."
|
|
(let ((save-silently t))
|
|
(package-unpack pkg-desc))
|
|
;; If we care, check it and *then* write the file.
|
|
- (let ((content (buffer-string)))
|
|
+ (let ((content (package--buffer-string)))
|
|
(package--check-signature
|
|
location file content nil
|
|
;; This function will be called after signature checking.
|
|
(lambda (&optional good-sigs)
|
|
;; Signature checked, unpack now.
|
|
- (with-temp-buffer (insert content)
|
|
- (let ((save-silently t))
|
|
- (package-unpack pkg-desc)))
|
|
+ (with-temp-buffer
|
|
+ (insert content)
|
|
+ (setq buffer-file-coding-system (package--cs content))
|
|
+ (let ((save-silently t))
|
|
+ (package-unpack pkg-desc)))
|
|
;; Here the package has been installed successfully, mark it as
|
|
;; signed if appropriate.
|
|
(when good-sigs
|
|
--
|
|
cgit v1.0-41-gc330
|
|
|
|
|