From unknown Sun Aug 17 22:00:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#48137 <48137@debbugs.gnu.org> To: bug#48137 <48137@debbugs.gnu.org> Subject: Status: 27.2; `package-install-file' fails when loading a package file with DOS line endings Reply-To: bug#48137 <48137@debbugs.gnu.org> Date: Mon, 18 Aug 2025 05:00:57 +0000 retitle 48137 27.2; `package-install-file' fails when loading a package fil= e with DOS line endings reassign 48137 emacs submitter 48137 Ioannis Kappas severity 48137 normal tag 48137 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 07:39:05 2021 Received: (at submit) by debbugs.gnu.org; 1 May 2021 11:39:05 +0000 Received: from localhost ([127.0.0.1]:35174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcnxh-0003Ck-AR for submit@debbugs.gnu.org; Sat, 01 May 2021 07:39:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:51698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcnxe-0003CM-SS for submit@debbugs.gnu.org; Sat, 01 May 2021 07:39:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcnxe-0001bl-JE for bug-gnu-emacs@gnu.org; Sat, 01 May 2021 07:39:02 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:45845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcnxb-0007MP-0k for bug-gnu-emacs@gnu.org; Sat, 01 May 2021 07:39:02 -0400 Received: by mail-ot1-x332.google.com with SMTP id f75-20020a9d03d10000b0290280def9ab76so852157otf.12 for ; Sat, 01 May 2021 04:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rpYVM8qdoaMmL6C7iA3fkRwQX8AsUpzNPrnDOORZ6Kg=; b=iFlEMKHi8S07Xu8LDqleq2zquxBxcrjzFMIbXXaMM2GousRxqQ8RuHv4Nm5rYmeKlV EvAVFeleZzZa9VIEbfSBTdaokDj5IcevwizAxwTHvjQcdnt+UzB4y8M+jxaanD1wHrdU UvYxQ+1qwfXH3pB+ELVZ9ZyapVcDmtQD+FuTwSiGwKvPQJek87vm7EZvvBfg/N2n/xWv dP1gNOrAhpj8+sTvbNa+ZNol1GR/E1reMZobwWUovlzIrrw29LK+9m2yPvWJimvJdgAc /6/rsoX2abZXsRGNEY+u3/PHAIqq2g2xlI04KO3aPg9xG5GhDZzNclA/ffhfvQo70k5j FODw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rpYVM8qdoaMmL6C7iA3fkRwQX8AsUpzNPrnDOORZ6Kg=; b=lg9yiq6dw7WjQPOscyw8qq1IXX0aO5Ax9IySOxNFHOihXgWYKCXSmOhLv/YThysaHf EEIDjkaoJtXYT3AQ56nF7sOR3z9Leyfj2jYBaTn7QZojqSmQ0tGSGZolHXLla71bGMdw Ku612dlKLDujUEcD+O3cRCKZhV5O/invousqcg0i06yVUdD4TcqSqHFMxUhG35rVYYun UT627zlejCtzapF0YHaOkRDlw2Z5NHS1r3jdDtuE5fI4DJOsu9+3FattKG7k4pMEieVX r18RRs9+qmJ9lwXMNbqxupGlsbVhqc3JY5uHjXjKWDXtGowbVjje4Qm0Tr+LJe/5p9Sy 5O6g== X-Gm-Message-State: AOAM532OAQdlrU93sxNMT6toHUCwu1toiGRGQ6dQoBy0OrTXmF8rqKAz p/tD+Or2EdznQXUOtBWMU1hB+xQ9ZaQYgsgBtrM54oiNHec= X-Google-Smtp-Source: ABdhPJwSoVj/rF0vGTmeLInoPL7PQP6Yye71asq8d1yTtzpEs9FmQrOkBtqC+51D3xQvCSF0/D/29+ie042MCpLOgOs= X-Received: by 2002:a9d:2de1:: with SMTP id g88mr7730182otb.5.1619869132232; Sat, 01 May 2021 04:38:52 -0700 (PDT) MIME-Version: 1.0 From: Ioannis Kappas Date: Sat, 1 May 2021 12:38:41 +0100 Message-ID: Subject: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary="00000000000036ac9c05c1432c47" Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=ioannis.kappas@gmail.com; helo=mail-ot1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --00000000000036ac9c05c1432c47 Content-Type: multipart/alternative; boundary="00000000000036ac9805c1432c45" --00000000000036ac9805c1432c45 Content-Type: text/plain; charset="UTF-8" There is an issue with `package-install-file' that fails with the following error when trying to install a file written with DOS line endings: error: Package lacks a "Version" or "Package-Version" header (This is more apparent on MS-Windows which writes files with DOS line endings by default) To reproduce, create a minimal package file with Emacs on MS-Windows and write it to disk as package-install-file-test-win.el: ;;; package-install-file-test-win.el --- test issue ;; Version: 0.1 (provide 'package-install-file-test-win) ;;; package-install-file-test-win.el ends here Then M-x package-install-file RET package-install-file-test-win.el RET and it should produce the error. The above succeeds on GNU/Linux and installs the dummy package as expected. I have attached an ert test to do the same. The test fail on windows and succeeds on Linux. You can run it from command line as: : emacs -Q --batch -l ert -l ./issue-package-install-file-test.el -f ert-run-tests-batch The cause appears to be that 'package can't handle package files encoded with DOS line endings. Analysis to follow. --00000000000036ac9805c1432c45 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There is an issue with `package-inst= all-file' that fails with the
following error when trying to = install a file written with DOS line
endings:

error: Package lacks a "Version" or "Package-Version&q= uot; header

(This is more apparent on MS-Windows w= hich writes files with DOS line
endings by default)
To reproduce, create a minimal package file with Emacs on MS-Wi= ndows
and write it to disk as package-install-file-test-win.el:

;;; package-install-file-test-win.el --- test issue= =C2=A0

;; Version: 0.1

(p= rovide 'package-install-file-test-win)

;;; pac= kage-install-file-test-win.el ends here


=
Then M-x package-install-file RET package-install-file-test-win.el RET=

and it should produce the error.

The above succeeds on GNU/Linux and installs the dummy package as<= /div>
expected.

I have attached an ert test to= do the same. The test fail on windows
and succeeds on Linux.

You can run it from command line as:

: emacs -Q --batch -l ert -l ./issue-package-install-file-test.el = -f ert-run-tests-batch

The cause appears to be tha= t 'package can't handle package files
encoded with DOS li= ne endings. Analysis to follow.

--00000000000036ac9805c1432c45-- --00000000000036ac9c05c1432c47 Content-Type: application/octet-stream; name="issue-package-install-file-test.el" Content-Disposition: attachment; filename="issue-package-install-file-test.el" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ko5o5gxd0 Ozs7IC0qLSBsZXhpY2FsLWJpbmRpbmc6IHQ7IC0qLQ0KKHJlcXVpcmUgJ2VydCkNCg0KKGRlZmNv bnN0IHRlc3QvcGFja2FnZSAiOzs7IHBhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luLmVsIC0t LSB0ZXN0IGlzc3VlIA0KDQo7OyBWZXJzaW9uOiAwLjENCg0KKGRlZnVuIHBhY2thZ2UtaW5zdGFs bC1maWxlLXRlc3Qtd2luLzUgKCkgNSkNCg0KKHByb3ZpZGUgJ3BhY2thZ2UtaW5zdGFsbC1maWxl LXRlc3Qtd2luKQ0KDQo7OzsgcGFja2FnZS1pbnN0YWxsLWZpbGUtdGVzdC13aW4uZWwgZW5kcyBo ZXJlDQoiDQogICJNaW5pbWFsIHRlc3QgcGFja2FnZSBmaWxlIikNCg0KKGVydC1kZWZ0ZXN0IHBh Y2thZ2UtaW5zdGFsbC1maWxlICgpDQogICJUZXN0IHRoYXQgcGFja2FnZSBpbnN0YWxsIGZpbGUg d29ya3Mgb24gYSBtaW5pbWFsIHBhY2thZ2UgZmlsZQ0Kd3JpdHRlbiB0byBkaXNrIGJ5IEVtYWNz LiINCiAgKG1lc3NhZ2UgIjpzeXN0ZW0gJXMgOnZlcnNpb24gJXMiIHN5c3RlbS1jb25maWd1cmF0 aW9uIGVtYWNzLXZlcnNpb24pDQoNCiAgKGxldCogKCh0ZW1wLWRpciAobWFrZS10ZW1wLWZpbGUg InBhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luIiB0KSkNCiAgICAgICAgIChwYWNrYWdlLXBh dGggKGV4cGFuZC1maWxlLW5hbWUNCiAgICAgICAgICAgICAgICAgICAgICAgICJwYWNrYWdlLWlu c3RhbGwtZmlsZS10ZXN0LXdpbi5lbCINCiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAtZGly KSkpDQogICAgOzsgd3JpdGUgZmlsZSBpbiB0aGUgZGVmYXVsdCBlbmNvZGluZw0KICAgICh3aXRo LXRlbXAtYnVmZmVyDQogICAgICAoaW5zZXJ0IHRlc3QvcGFja2FnZSkNCiAgICAgICh3cml0ZS1y ZWdpb24gKHBvaW50LW1pbikgKHBvaW50LW1heCkgcGFja2FnZS1wYXRoKSkNCiAgICAobWVzc2Fn ZSAiOnBhY2thZ2UtZmlsZS1jcmVhdGVkLWF0ICVzIiBwYWNrYWdlLXBhdGgpDQoNCiAgICA7OyBy ZXBvcnQgb24gZmlsZSBlbmNvZGluZw0KICAgICh3aXRoLXRlbXAtYnVmZmVyDQogICAgICAoaW5z ZXJ0LWZpbGUtY29udGVudHMgcGFja2FnZS1wYXRoKQ0KICAgICAgKGxldCogKChjb250ZW50cyAo YnVmZmVyLXN0cmluZykpKQ0KICAgICAgICAobWVzc2FnZSAiOnBhY2thZ2UtZmlsZS1jb2Rpbmct c3lzdGVtICVzIiBidWZmZXItZmlsZS1jb2Rpbmctc3lzdGVtKSkpDQoNCiAgICA7OyBpbnN0YWxs IHBhY2thZ2UNCiAgICAocGFja2FnZS1pbnN0YWxsLWZpbGUgcGFja2FnZS1wYXRoKQ0KICAgIChk ZWxldGUtZGlyZWN0b3J5IHRlbXAtZGlyIHQpDQoNCiAgICANCiAgICA7OyBjYWxsIGR1bW15IGZ1 bmN0aW9uDQogICAgKHJlcXVpcmUgJ3BhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luKQ0KICAg IChzaG91bGQgKGVxdWFsIDUgKHBhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luLzUpKSkNCg0K ICAgIDs7IHJlbW92ZSBwYWNrYWdlDQogICAgKHBhY2thZ2UtZGVsZXRlIChjYWRyIChhc3NxICdw YWNrYWdlLWluc3RhbGwtZmlsZS10ZXN0LXdpbiBwYWNrYWdlLWFsaXN0KSkpKSkNCg== --00000000000036ac9c05c1432c47-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 07:48:24 2021 Received: (at 48137) by debbugs.gnu.org; 1 May 2021 11:48:24 +0000 Received: from localhost ([127.0.0.1]:35450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lco6i-0003rF-FD for submit@debbugs.gnu.org; Sat, 01 May 2021 07:48:24 -0400 Received: from mail-oo1-f45.google.com ([209.85.161.45]:38731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lco6h-0003r1-1e for 48137@debbugs.gnu.org; Sat, 01 May 2021 07:48:23 -0400 Received: by mail-oo1-f45.google.com with SMTP id h9-20020a4a94090000b02901f9d4f64172so215543ooi.5 for <48137@debbugs.gnu.org>; Sat, 01 May 2021 04:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=d7c1LiokAfsLbHgZVLq4PjA/S+RDt+Ca8pCE7VeGmVY=; b=MxJtZkjhsuayDyvIT8Xw5KeZC8SUUnrfSblzxvJWjbSyNvv6ov9BlYSLCPsQQCheSV xyVkGCVd/7ZA9vpRsQK/3dcW+CshuGzLsc1rXbUAg5qFSme4ffxGF7MK8qOD0myo3TuC 5/bBcwHnP4iy2iAHvbT/CMSMzW4R0h8YPNWDUW31Lu3Jkqz8xAaAtIVwQb1mnR/4ckQ8 aq9aor4nfh+a6OmzNdqQats353SEEzixgbEqbvp2QbGzkjvC0Lbr+Cxk9QZL24nD7jvB 0kX4ObeyEWOmsdFMilri1mqox06lA5Yof/iMiQDevB2zIwI/oP9iSIKbQx+6TzUarx4N j9SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=d7c1LiokAfsLbHgZVLq4PjA/S+RDt+Ca8pCE7VeGmVY=; b=KmG/6rvnbDD7AYaExQQgWGDs2D8VJUMowkW9uBfWpBd7KUqeLQ0iIQe4NObAYUKjKp 0Sf9R/SUF77Iqted5zGT8FgajT78AG4ZVnu2XyhZ/CpzFFwev1BvTwZDGygb71MuVAQJ DSshnF1w0bw1cnGUl90J3qHMsBpOLKp1QiojretA84HcE7yfhsKsXRXu2armAJrQsus6 BvLk9XCNYBWGJ94ZskMUsAkKqRuzwzdI4AtVpWuUMyzqB7jmkKoUCm298/hiOB6ZAC1V iILG3wTuxHxA2PodTMzbWQ3PC9qxtLO5uDU0z6Ckv+IcBD575tQ+qEN2HYZriv9Nad3t QmZQ== X-Gm-Message-State: AOAM533Jblz99y2TN1bHdUV6jTXANZOi5sTfaC1TbK9FI1VhC5eCk9iF vRJJRAO0qgyu9hNNZ68Q0q8IWcFTDp5Lus9j33eo8OOUXVg= X-Google-Smtp-Source: ABdhPJz7jfkCkr67FiAPcIHI7jcku245u0OK9oWEs4ezrIqjPGGJD0uQmo+oN+OEb7l2o1pA0glWtj82ndPllhffuXo= X-Received: by 2002:a4a:e692:: with SMTP id u18mr8268435oot.54.1619869697257; Sat, 01 May 2021 04:48:17 -0700 (PDT) MIME-Version: 1.0 From: Ioannis Kappas Date: Sat, 1 May 2021 12:48:06 +0100 Message-ID: Subject: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: 48137@debbugs.gnu.org Content-Type: multipart/mixed; boundary="000000000000e3480405c1434d4d" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000e3480405c1434d4d Content-Type: text/plain; charset="UTF-8" The error appears to be a side effect of `package-install-file' loading the file literally with `insert-file-contents-literally' and thus setting the coding system to 'no-conversion (as reported by the `buffer-file-coding-system' variable ). This means that for a DOS encoded file the ?\r (Carriage Return) in the DOS line ending ?\r?\n will be treated as an independent control character rather than consumed as part of the line ending as far as Emacs is concerned. This extra control character in our case appears in the version number extracted with `lm-header' (.e.g. "0.1^M"), failing the `version-to-list' conversion in `package-buffer-info'->`package-strip-rcs-id', resulting to the error that it lacks a version header. It is not obvious why `package-install-file' loads package files literally at all times, `package--with-response-buffer-1' also does the same. If the reason turns out not to be important, then a possible solution could be to load package files metaphorically: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ecb2573cab..98d63f1aff 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2147,8 +2147,11 @@ package-install-file (progn (setq default-directory file) (dired-mode)) - (insert-file-contents-literally file) - (when (string-match "\\.tar\\'" file) (tar-mode))) + (if (string-match "\\.tar\\'" file) + (progn + (insert-file-contents-literally file) + (tar-mode)) + (insert-file-contents file))) (package-install-from-buffer))) ;;;###autoload and perhaps the same can be extended to `package--with-response-buffer-1'. Another solution could be to upgrade the 'lisp-mnt package to ignore ?\r characters. Looking at the `lm-header' fn invoked by `package-buffer-info', it does have a list of characters to stop at when looking for a header, we can thus add the carriage return to the list: diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 9cba232e16..3eb493d286 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -267,7 +267,7 @@ lm-header (if (save-excursion (skip-chars-backward "^$" (match-beginning 0)) (= (point) (match-beginning 0))) - "[^\n]+" "[^$\n]+"))) + "[^\n\r]+" "[^$\n\r]+"))) (match-string-no-properties 0)))) (defun lm-header-multiline (header) The attached issue-package-install-file-test-up1.el, is an updated ert including an additional `header' test for the above. Or is it perhaps that packages should only be written with Unix line endings and thus the solution is to update documentation and create more targeted error messages? I don't have a thorough understanding of 'package, so please feel free to scrutinize the above/suggest alternatives. Thanks --000000000000e3480405c1434d4d Content-Type: application/octet-stream; name="issue-package-install-file-test-up1.el" Content-Disposition: attachment; filename="issue-package-install-file-test-up1.el" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ko5ojm4l0 Ozs7IC0qLSBsZXhpY2FsLWJpbmRpbmc6IHQ7IC0qLQ0KKHJlcXVpcmUgJ2VydCkNCg0KKGRlZmNv bnN0IHRlc3QvcGFja2FnZSAiOzs7IHBhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luLmVsIC0t LSB0ZXN0IGlzc3VlIA0KDQo7OyBWZXJzaW9uOiAwLjENCg0KKGRlZnVuIHBhY2thZ2UtaW5zdGFs bC1maWxlLXRlc3Qtd2luLzUgKCkgNSkNCg0KKHByb3ZpZGUgJ3BhY2thZ2UtaW5zdGFsbC1maWxl LXRlc3Qtd2luKQ0KDQo7OzsgcGFja2FnZS1pbnN0YWxsLWZpbGUtdGVzdC13aW4uZWwgZW5kcyBo ZXJlDQoiDQogICJNaW5pbWFsIHRlc3QgcGFja2FnZSBmaWxlIikNCg0KKGVydC1kZWZ0ZXN0IHBh Y2thZ2UtaW5zdGFsbC1maWxlICgpDQogICJUZXN0IHRoYXQgcGFja2FnZSBpbnN0YWxsIGZpbGUg d29ya3Mgb24gYSBtaW5pbWFsIHBhY2thZ2UgZmlsZQ0Kd3JpdHRlbiB0byBkaXNrIGJ5IEVtYWNz LiINCiAgKG1lc3NhZ2UgIjpzeXN0ZW0gJXMgOnZlcnNpb24gJXMiIHN5c3RlbS1jb25maWd1cmF0 aW9uIGVtYWNzLXZlcnNpb24pDQoNCiAgKGxldCogKCh0ZW1wLWRpciAobWFrZS10ZW1wLWZpbGUg InBhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luIiB0KSkNCiAgICAgICAgIChwYWNrYWdlLXBh dGggKGV4cGFuZC1maWxlLW5hbWUNCiAgICAgICAgICAgICAgICAgICAgICAgICJwYWNrYWdlLWlu c3RhbGwtZmlsZS10ZXN0LXdpbi5lbCINCiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAtZGly KSkpDQogICAgOzsgd3JpdGUgZmlsZSBpbiB0aGUgZGVmYXVsdCBlbmNvZGluZw0KICAgICh3aXRo LXRlbXAtYnVmZmVyDQogICAgICAoaW5zZXJ0IHRlc3QvcGFja2FnZSkNCiAgICAgICh3cml0ZS1y ZWdpb24gKHBvaW50LW1pbikgKHBvaW50LW1heCkgcGFja2FnZS1wYXRoKSkNCiAgICAobWVzc2Fn ZSAiOnBhY2thZ2UtZmlsZS1jcmVhdGVkLWF0ICVzIiBwYWNrYWdlLXBhdGgpDQoNCiAgICA7OyBy ZXBvcnQgb24gZmlsZSBlbmNvZGluZw0KICAgICh3aXRoLXRlbXAtYnVmZmVyDQogICAgICAoaW5z ZXJ0LWZpbGUtY29udGVudHMgcGFja2FnZS1wYXRoKQ0KICAgICAgKGxldCogKChjb250ZW50cyAo YnVmZmVyLXN0cmluZykpKQ0KICAgICAgICAobWVzc2FnZSAiOnBhY2thZ2UtZmlsZS1jb2Rpbmct c3lzdGVtICVzIiBidWZmZXItZmlsZS1jb2Rpbmctc3lzdGVtKSkpDQoNCiAgICA7OyBpbnN0YWxs IHBhY2thZ2UNCiAgICAocGFja2FnZS1pbnN0YWxsLWZpbGUgcGFja2FnZS1wYXRoKQ0KICAgIChk ZWxldGUtZGlyZWN0b3J5IHRlbXAtZGlyIHQpDQoNCiAgICANCiAgICA7OyBjYWxsIGR1bW15IGZ1 bmN0aW9uDQogICAgKHJlcXVpcmUgJ3BhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luKQ0KICAg IChzaG91bGQgKGVxdWFsIDUgKHBhY2thZ2UtaW5zdGFsbC1maWxlLXRlc3Qtd2luLzUpKSkNCg0K ICAgIDs7IHJlbW92ZSBwYWNrYWdlDQogICAgKHBhY2thZ2UtZGVsZXRlIChjYWRyIChhc3NxICdw YWNrYWdlLWluc3RhbGwtZmlsZS10ZXN0LXdpbiBwYWNrYWdlLWFsaXN0KSkpKSkNCg0KKHJlcXVp cmUgJ2xpc3AtbW50KQ0KKGVydC1kZWZ0ZXN0IGhlYWRlciAoKQ0KICAiVGVzdCB0aGF0IGxtLWhl YWRlciBjYW4gcmV0dXJuIHZlcnNpb24gaW5mb3JtYXRpb24gb24gYSBkb3MNCmNvZGVkIHBhY2th Z2VkIGZpbGUgbG9hZGVkIGxpdGVyYWxseSAobWltaWNraW5nICdwYWNrYWdlKSINCiAgKG1lc3Nh Z2UgIjpzeXN0ZW0gJXMgOnZlcnNpb24gJXMiIHN5c3RlbS1jb25maWd1cmF0aW9uIGVtYWNzLXZl cnNpb24pDQoNCiAgKGxldCogKCh0ZW1wLWRpciAobWFrZS10ZW1wLWZpbGUgInBhY2thZ2UtaW5z dGFsbC1maWxlLXRlc3Qtd2luIiB0KSkNCiAgICAgICAgIChwYWNrYWdlLXBhdGggKGV4cGFuZC1m aWxlLW5hbWUNCiAgICAgICAgICAgICAgICAgICAgICAgICJwYWNrYWdlLWluc3RhbGwtZmlsZS10 ZXN0LXdpbi5lbCINCiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAtZGlyKSkpDQogICAgOzsg d3JpdGUgd2l0aCBkb3MgbGluZSBlbmRpbmdzDQogICAgKHdpdGgtdGVtcC1idWZmZXINCiAgICAg IChpbnNlcnQgdGVzdC9wYWNrYWdlKQ0KICAgICAgKGxldCAoKGNvZGluZy1zeXN0ZW0tZm9yLXdy aXRlICdwcmVmZXItdXRmLTgtZG9zKSkNCiAgICAgICAgKHdyaXRlLXJlZ2lvbiAocG9pbnQtbWlu KSAocG9pbnQtbWF4KSBwYWNrYWdlLXBhdGgpKQ0KICAgICAgKG1lc3NhZ2UgIjpwYWNrYWdlLWZp bGUtY29kaW5nLXN5c3RlbSAlcyIgYnVmZmVyLWZpbGUtY29kaW5nLXN5c3RlbSkpDQogICAgDQog ICAgKG1lc3NhZ2UgIjpwYWNrYWdlLWZpbGUtY3JlYXRlZC1hdCAlcyIgcGFja2FnZS1wYXRoKQ0K ICAgIDs7IGxvYWQgbGl0ZXJhbGx5DQogICAgKHdpdGgtdGVtcC1idWZmZXINCiAgICAgIChpbnNl cnQtZmlsZS1jb250ZW50cy1saXRlcmFsbHkgcGFja2FnZS1wYXRoKQ0KICAgICAgKGdvdG8tY2hh ciAocG9pbnQtbWluKSkNCiAgICAgIChzaG91bGQgKHN0cmluZz0gIjAuMSIgKGxtLWhlYWRlciAi dmVyc2lvbiIpKSkpDQoNCiAgICAoZGVsZXRlLWRpcmVjdG9yeSB0ZW1wLWRpciB0KSkpDQo= --000000000000e3480405c1434d4d-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 08:15:32 2021 Received: (at 48137) by debbugs.gnu.org; 1 May 2021 12:15:32 +0000 Received: from localhost ([127.0.0.1]:36324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcoWx-0004t9-QK for submit@debbugs.gnu.org; Sat, 01 May 2021 08:15:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcoWw-0004t3-0x for 48137@debbugs.gnu.org; Sat, 01 May 2021 08:15:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42737) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcoWq-0004oZ-DA; Sat, 01 May 2021 08:15:24 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4218 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lcoWp-0007VQ-Oe; Sat, 01 May 2021 08:15:24 -0400 Date: Sat, 01 May 2021 15:15:19 +0300 Message-Id: <834kfmabvs.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas , Stefan Monnier In-Reply-To: (message from Ioannis Kappas on Sat, 1 May 2021 12:48:06 +0100) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Sat, 1 May 2021 12:48:06 +0100 > > The error appears to be a side effect of `package-install-file' > loading the file literally with `insert-file-contents-literally' and > thus setting the coding system to 'no-conversion (as reported by the > `buffer-file-coding-system' variable ). This means that for a DOS > encoded file the ?\r (Carriage Return) in the DOS line ending ?\r?\n > will be treated as an independent control character rather than > consumed as part of the line ending as far as Emacs is concerned. > > This extra control character in our case appears in the version number > extracted with `lm-header' (.e.g. "0.1^M"), failing the > `version-to-list' conversion in > `package-buffer-info'->`package-strip-rcs-id', resulting to the error > that it lacks a version header. > > It is not obvious why `package-install-file' loads package files > literally at all times, `package--with-response-buffer-1' also does > the same. If the reason turns out not to be important, then a possible > solution could be to load package files metaphorically: > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index ecb2573cab..98d63f1aff 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -2147,8 +2147,11 @@ package-install-file > (progn > (setq default-directory file) > (dired-mode)) > - (insert-file-contents-literally file) > - (when (string-match "\\.tar\\'" file) (tar-mode))) > + (if (string-match "\\.tar\\'" file) > + (progn > + (insert-file-contents-literally file) > + (tar-mode)) > + (insert-file-contents file))) I don't think this is TRT, because insert-file-contents also decodes the character encoding, not just the EOL encoding. > Another solution could be to upgrade the 'lisp-mnt package to ignore > ?\r characters. Looking at the `lm-header' fn invoked by > `package-buffer-info', it does have a list of characters to stop at > when looking for a header, we can thus add the carriage return to the > list: > > diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el > index 9cba232e16..3eb493d286 100644 > --- a/lisp/emacs-lisp/lisp-mnt.el > +++ b/lisp/emacs-lisp/lisp-mnt.el > @@ -267,7 +267,7 @@ lm-header > (if (save-excursion > (skip-chars-backward "^$" (match-beginning 0)) > (= (point) (match-beginning 0))) > - "[^\n]+" "[^$\n]+"))) > + "[^\n\r]+" "[^$\n\r]+"))) This is better, but IMO the code should be rewritten not to allow a lone CR character, only either a lone LF or the CRLF pair. > Or is it perhaps that packages should only be written with Unix line > endings and thus the solution is to update documentation and create > more targeted error messages? This is probably the best, IMO. Stefan? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 09:51:16 2021 Received: (at 48137) by debbugs.gnu.org; 1 May 2021 13:51:17 +0000 Received: from localhost ([127.0.0.1]:36420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcq1c-0005lz-Mu for submit@debbugs.gnu.org; Sat, 01 May 2021 09:51:16 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcq1b-0005lr-Uw for 48137@debbugs.gnu.org; Sat, 01 May 2021 09:51:16 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5829F808A3; Sat, 1 May 2021 09:51:10 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 831C2801AB; Sat, 1 May 2021 09:51:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1619877064; bh=RxMiAwYnAydaM+fKnopbz23DUYwo9iCA8bVf5uJ3VLA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=UdpGiSk4dZy/HTVwLrhZGGUqBCkQRMBSTBLHf1lI7Ux2zXDcqVauOS76kvym+isxY QJ/QMpNg74jjFO5gQ50ImQEY0Lk9LH/j3/uDRb4Ab5axAXad3ODGTayJMOugWIcGb/ MD5JruWjhtohu+QehqLGRh4U7zNKFrMHNeSUmpar82SIkq0ymMbScQkFTx40zxptWD 7NwDje4IWnUArviZuverYMyhDvnwnaMdYAWFjHdXgcoCCmU6fvSUh/n2VIVJg56znr QhOt6VIrYyZsdaEJ3pn1l/Ed+z6oh5fn4gkl41oI42xsnQO3Pfm5dAdiuGTWY5enbe Pt99vQ0UCtfMg== Received: from alfajor (unknown [108.161.125.61]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 51F2612027F; Sat, 1 May 2021 09:51:04 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> Date: Sat, 01 May 2021 09:51:03 -0400 In-Reply-To: <834kfmabvs.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 01 May 2021 15:15:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.069 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: Ioannis Kappas , 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el >> index ecb2573cab..98d63f1aff 100644 >> --- a/lisp/emacs-lisp/package.el >> +++ b/lisp/emacs-lisp/package.el >> @@ -2147,8 +2147,11 @@ package-install-file >> (progn >> (setq default-directory file) >> (dired-mode)) >> - (insert-file-contents-literally file) >> - (when (string-match "\\.tar\\'" file) (tar-mode))) >> + (if (string-match "\\.tar\\'" file) >> + (progn >> + (insert-file-contents-literally file) >> + (tar-mode)) >> + (insert-file-contents file))) > > I don't think this is TRT, because insert-file-contents also decodes > the character encoding, not just the EOL encoding. I think for `.el` files it's actually correct to decode the character encoding here (it's maybe not necessary, but I think it's at least as correct as what we do now, since `package-install-from-buffer` expects a "normal" buffer, hence for `.el` buffers it expects one where characters have been decoded). BTW, this code needs some love, for example to handle `.tar.lz` files. >> Or is it perhaps that packages should only be written with Unix line >> endings and thus the solution is to update documentation and create >> more targeted error messages? > This is probably the best, IMO. Stefan? It sounds like a good idea as well, yes. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 13:47:51 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 17:47:51 +0000 Received: from localhost ([127.0.0.1]:47794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldcff-0003O8-En for submit@debbugs.gnu.org; Mon, 03 May 2021 13:47:51 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:41811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldcfe-0003O1-FP for 48137@debbugs.gnu.org; Mon, 03 May 2021 13:47:51 -0400 Received: by mail-ot1-f49.google.com with SMTP id c36-20020a05683034a4b02902a5b84b1d12so5452630otu.8 for <48137@debbugs.gnu.org>; Mon, 03 May 2021 10:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pQC6QmxFThrhKGujylNWkJIHaG77VQrjq18tkyVNM4w=; b=VEKJK0PPKUROI4s4oEesClFAckga2O3cRoK9NjzI76vpIlmGzt43Y/iUMkzM09c+Ey ELfRFQiyaNJqjZuL/23MDCrwZ0wQTMTqze9e2JDkzW+B5UyX6vi1pL05XZmhyVvq/Zqd 8ppd+CJLru8vrVU9o/waFmy1S/7NDBuv2AyLtULGxZPNMnpR3ZhPfdsnqLeljBxmpVdn LCd4KsflpKsa7juhhDEPX4XsWO+NiHD74ijN/mtoTVpRNfC6VsNKo05/3nBfvAI83y0C Hw035tn/WDb10q/PwRoODeBftyS+MZm5kZji9IwUqA5cR8VuOYDbL6jicD6iVoEELnaS 0X7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pQC6QmxFThrhKGujylNWkJIHaG77VQrjq18tkyVNM4w=; b=A0mvJx/BhuhKfcBwbkiHFTQKRpPW85QRVRcXNcXSkLZ1lSWiejDMSECmoRG8wM8E5c Kq0oKIYt6oG33yKeafDFZUWgWeFPsIvIb7X9sLRdSYW4KFzh6kHmpg7Xa3vazFm7gdc/ FNBp7XH/MYM0xpfkrsLM4T9ThVDFOByj1w05V6P+rGezEQIyRWR/YUTzv1Lg51GZpUxa xRrb2U7WrIVA239x/iOZNrcPwlJdFL6FvAKvbLVEIzF0G8D5X512XtwcXEDVtXLq3qXG r9WJSzSsHh9p4JdwfrBXJor5YmC/jbsPKHtjl8VnbiwyTivxh7G+nAxMehUVflcVpmAh 3m+g== X-Gm-Message-State: AOAM533lirXayF8cWDmt+W1u202374ngJFER8kHDQ5ohHAgEickC4L3b jd0llxFyK2klYPSP4ziRWWqViLPDEsEKlMvUhr7vk6RJS+k= X-Google-Smtp-Source: ABdhPJx8FLOJ6mnpIkSP6B5MUZbNnd0uBPyN/QnLRvasjNX2Ot8+ef+xPjJR8NkXo8sP0HKAK6mhSdFQMZcal+h3164= X-Received: by 2002:a9d:2de1:: with SMTP id g88mr16486466otb.5.1620064064700; Mon, 03 May 2021 10:47:44 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> In-Reply-To: From: Ioannis Kappas Date: Mon, 3 May 2021 18:47:34 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: Eli Zaretskii , 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, May 1, 2021 at 2:51 PM Stefan Monnier wrote: > > I don't think this is TRT, because insert-file-contents also decodes > > the character encoding, not just the EOL encoding. > > I think for `.el` files it's actually correct to decode the character > encoding here (it's maybe not necessary, but I think it's at least > as correct as what we do now, since `package-install-from-buffer` > expects a "normal" buffer, hence for `.el` buffers it expects one where > characters have been decoded). > Thanks Stefan. Does this also apply to the only other use of `insert-file-contents-literally' in 'package,? In particular `package--with-response-buffer-1' is referenced by `package-check-signature' and `package--download-one-archive'. (I am personally more in favor of supporting DOS files, because it makes the caller's life easier on MS-Windows and brings them on par with Unix, though Eli's concern has to be addressed first) From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 14:24:17 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 18:24:17 +0000 Received: from localhost ([127.0.0.1]:48000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lddEv-0003kp-A0 for submit@debbugs.gnu.org; Mon, 03 May 2021 14:24:17 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:21516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lddEf-0003kR-FG for 48137@debbugs.gnu.org; Mon, 03 May 2021 14:24:16 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 26EAA809E6; Mon, 3 May 2021 14:23:56 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7EC7580194; Mon, 3 May 2021 14:23:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620066234; bh=7oAX1VrDOsVrif9T/5yfcmfyGTDRZiNO+KMPrBjbNlU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=n3E+Xa4cwz8RnfcfjWt1DgLOi7YIk1ah8uXPA/Ql4vOD8WNCX//N+8jFTfUq65tSk 7tQvzL4gLBU+EdB2ZIy7qARPMIEIQxb+/huDzSxXK1EpmGH18ZH7IRUL+DtPTrBYAr nwnIeFH/fEDX6vlrXvcjQaiV8AxkdYXAZjjr27V1RFrTlw3WTFQhP7vXT6HeCkaRRF gTSaMFVIXgNiTcHhT+aIhYxfJp2Y4U3/ck8F8ylwpfkg8RMsH6RES2ltAHgMIv0BzF jaz/raW0JgL0QYedcUFZzQwI57L6cY9KHIkHqbwq+SBay7NfsBqd+3E0MkVvF/5mDI 9xTYnb8AqqDIg== Received: from alfajor (unknown [108.161.125.61]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3D1DE1201B5; Mon, 3 May 2021 14:23:54 -0400 (EDT) From: Stefan Monnier To: Ioannis Kappas Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> Date: Mon, 03 May 2021 14:23:53 -0400 In-Reply-To: (Ioannis Kappas's message of "Mon, 3 May 2021 18:47:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.035 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: Eli Zaretskii , 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ioannis Kappas [2021-05-03 18:47:34] wrote: > On Sat, May 1, 2021 at 2:51 PM Stefan Monnier wrote: >> > I don't think this is TRT, because insert-file-contents also decodes >> > the character encoding, not just the EOL encoding. >> >> I think for `.el` files it's actually correct to decode the character >> encoding here (it's maybe not necessary, but I think it's at least >> as correct as what we do now, since `package-install-from-buffer` >> expects a "normal" buffer, hence for `.el` buffers it expects one where >> characters have been decoded). > Thanks Stefan. Does this also apply to the only other use of > `insert-file-contents-literally' in 'package,? I don't think so, no. > In particular `package--with-response-buffer-1' is referenced by > `package-check-signature' This definitely needs to deal with bytes only, we don't want any encoding/decoding to risk changing the byte contents. > and `package--download-one-archive'. I think the same is true here. > (I am personally more in favor of supporting DOS files, because it > makes the caller's life easier on MS-Windows and brings them on par > with Unix, though Eli's concern has to be addressed first) My own opinion is that .el files are files that belong to Emacs and they should use Emacs's "native" file format, whatever that is. I think the "most native" would be `utf-8-emacs-unix` so I'd be OK with deprecating all other encodings, but I don't think that's going to happen ;-) My comment on that subject was instead focused on files distributed via ELPA (and hence wouldn't really apply to `package-install-file`): we could document that those files should use utf-8 and unix EOLs. At the same time, I haven't seen a clear technical benefit to imposing such a constraint, so it's probably not worth the trouble. [ There can be a real technical advantage to imposing `utf-8-emacs-unix` for .el files since it can save us the trip through `load-with-code-conversion` which slows down `load`ing non-byte-compiled files, but that doesn't matter much for ELPA files since those are usually byte-compiled anyway. ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 14:33:57 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 18:33:57 +0000 Received: from localhost ([127.0.0.1]:48041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lddOH-0003qK-CJ for submit@debbugs.gnu.org; Mon, 03 May 2021 14:33:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lddOF-0003qB-QW for 48137@debbugs.gnu.org; Mon, 03 May 2021 14:33:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59914) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lddOA-000704-Je; Mon, 03 May 2021 14:33:50 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1190 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lddO6-0006uZ-LB; Mon, 03 May 2021 14:33:47 -0400 Date: Mon, 03 May 2021 21:33:29 +0300 Message-Id: <83tunj651i.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Mon, 03 May 2021 14:23:53 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 48137@debbugs.gnu.org > Date: Mon, 03 May 2021 14:23:53 -0400 > > > Thanks Stefan. Does this also apply to the only other use of > > `insert-file-contents-literally' in 'package,? > > I don't think so, no. > > > In particular `package--with-response-buffer-1' is referenced by > > `package-check-signature' > > This definitely needs to deal with bytes only, we don't want any > encoding/decoding to risk changing the byte contents. > > > and `package--download-one-archive'. > > I think the same is true here. > > > (I am personally more in favor of supporting DOS files, because it > > makes the caller's life easier on MS-Windows and brings them on par > > with Unix, though Eli's concern has to be addressed first) > > My own opinion is that .el files are files that belong to Emacs and they > should use Emacs's "native" file format, whatever that is. I think the > "most native" would be `utf-8-emacs-unix` so I'd be OK with deprecating > all other encodings, but I don't think that's going to happen ;-) I think it's wrong for package.el to try to decode these files. It should deliver the files to the disk exactly as they are received through the wire. And the only safe way of doing that is to treat these files as raw bytes. Where we must interpret some parts of the files, we should take precautions to handle the complications related to the encoding, but we should not try to decode anything. From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 14:49:59 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 18:49:59 +0000 Received: from localhost ([127.0.0.1]:48102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldddm-0003yv-Rp for submit@debbugs.gnu.org; Mon, 03 May 2021 14:49:59 -0400 Received: from mail-oi1-f170.google.com ([209.85.167.170]:36787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldddW-0003yl-Is for 48137@debbugs.gnu.org; Mon, 03 May 2021 14:49:57 -0400 Received: by mail-oi1-f170.google.com with SMTP id i26so6364878oii.3 for <48137@debbugs.gnu.org>; Mon, 03 May 2021 11:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O/haL5FxmLaBqUVhXMiNooZ2O5T2W5hv9mOM6qU/bXc=; b=KgkdYI6ox/s1juxSuBUsEVN/gWeDX2Yl3SHsG9BQl80S7jVfGx+KS22VZCl1IV8DW/ lRVS+DuoJM3XQKB5P5Iz0ZvH3fizW6SKIgqDsiLjd2t689f3s2BezXfp4YirXOFrdiCx xA/lRAQWJENeFfJ5jiI5cWNfWe+bHz3jUTRV3be6VzEy+pxS8Cs6LLgo4IJ+45WlOHQC 7kZjztuKohpqkRQ1EZkI3wqbI2pkjPCbKdiv9ifttOHBFj7dupyXNUBGxUIfYNZcRJ/k 10T3kM6yA/Nl+qWl/CC4FMYG0mxJQ1t+/B8A+B4Rq9HPoqmsefSzLgmIrzfzBP4dbDDg hNOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O/haL5FxmLaBqUVhXMiNooZ2O5T2W5hv9mOM6qU/bXc=; b=K4wOmj9vjKs1UHVdeJQBxUSQyD+cmTlEYVxKIeksiOjrHh7YWOgi7bTOQO1tBtXyX/ c7zXBsKLbbQrhmlP7gAyfUpNpbMf9IDLIIOTV75euZpYCIqeQPgjAntLn9duiGH4QOPG OOTE7JuBaP+FKGIDakJ+VnPWRgiLIpoVO3q9DJMbcuQwSokACZgIzpYFHeLiGfTM2ryk 5OUfpUm8+pgN81yV6u1Dd2ZL/Oy4IaduBUuuZKGCZKrDVb0Cq03z+dVRvngTexHUfWG7 LcDk9asPrJNzK4sw6Bh/4U2BSRMqHdOVCX7m0JOl44U9Kne5/rFgPyNd9YNANr9DT+WQ HPTA== X-Gm-Message-State: AOAM531TVAYmrfyC0OK8hVw696z9W84m05JCSZ+kVnsJWkG8Nm7fUOJL atnBzdtd5rMt8F2ECvgtiUHv5eTfveLMiuWXjzE= X-Google-Smtp-Source: ABdhPJxyogsPXlmGSWRRJvqi+ypO2OMvnzxRT55xXd6vaXosKOC+9ZC4Vf66g41d/e6UFhDO0VWdtY35jhuhb2KwnMQ= X-Received: by 2002:aca:39d7:: with SMTP id g206mr18029592oia.122.1620067776859; Mon, 03 May 2021 11:49:36 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> In-Reply-To: <83tunj651i.fsf@gnu.org> From: Ioannis Kappas Date: Mon, 3 May 2021 19:49:27 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mon, May 3, 2021 at 7:33 PM Eli Zaretskii wrote: > > > From: Stefan Monnier > > Cc: Eli Zaretskii , 48137@debbugs.gnu.org > > Date: Mon, 03 May 2021 14:23:53 -0400 > > > > > Thanks Stefan. Does this also apply to the only other use of > > > `insert-file-contents-literally' in 'package,? > > > > I don't think so, no. > > > > > In particular `package--with-response-buffer-1' is referenced by > > > `package-check-signature' > > > > This definitely needs to deal with bytes only, we don't want any > > encoding/decoding to risk changing the byte contents. > > > > > and `package--download-one-archive'. > > > > I think the same is true here. > > > > > (I am personally more in favor of supporting DOS files, because it > > > makes the caller's life easier on MS-Windows and brings them on par > > > with Unix, though Eli's concern has to be addressed first) > > > > My own opinion is that .el files are files that belong to Emacs and they > > should use Emacs's "native" file format, whatever that is. I think the > > "most native" would be `utf-8-emacs-unix` so I'd be OK with deprecating > > all other encodings, but I don't think that's going to happen ;-) > > I think it's wrong for package.el to try to decode these files. It > should deliver the files to the disk exactly as they are received > through the wire. And the only safe way of doing that is to treat > these files as raw bytes. Where we must interpret some parts of the > files, we should take precautions to handle the complications related > to the encoding, but we should not try to decode anything. Thanks, I think there is agreement we shouldn't decode files coming from a remote archive. Are there still concerns though with decoding local .el files passed in to `package-install-file' supporting the windows DOS EOL case Eli? If not, I would like to suggest a slightly updated patch that is targeting .el files directly as an exemption: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ecb2573cab..19ab0445b9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2147,7 +2147,9 @@ package-install-file (progn (setq default-directory file) (dired-mode)) - (insert-file-contents-literally file) + (if (string-match "\\.el\\'" file) + (insert-file-contents file) + (insert-file-contents-literally file)) (when (string-match "\\.tar\\'" file) (tar-mode))) (package-install-from-buffer))) From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 14:53:04 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 18:53:04 +0000 Received: from localhost ([127.0.0.1]:48117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lddgl-00040n-RQ for submit@debbugs.gnu.org; Mon, 03 May 2021 14:53:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lddgj-00040Q-Rl for 48137@debbugs.gnu.org; Mon, 03 May 2021 14:53:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60193) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lddge-0008TB-6u; Mon, 03 May 2021 14:52:56 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2382 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lddgc-0000S6-Nj; Mon, 03 May 2021 14:52:55 -0400 Date: Mon, 03 May 2021 21:52:38 +0300 Message-Id: <83r1in645l.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Mon, 3 May 2021 19:49:27 +0100) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Mon, 3 May 2021 19:49:27 +0100 > Cc: Stefan Monnier , 48137@debbugs.gnu.org > > > I think it's wrong for package.el to try to decode these files. It > > should deliver the files to the disk exactly as they are received > > through the wire. And the only safe way of doing that is to treat > > these files as raw bytes. Where we must interpret some parts of the > > files, we should take precautions to handle the complications related > > to the encoding, but we should not try to decode anything. > > Thanks, I think there is agreement we shouldn't decode files coming > from a remote archive. Are there still concerns though with decoding > local .el files passed in to `package-install-file' supporting the > windows DOS EOL case Eli? Yes, I think we shouldn't decode _any_ files, not even the *.el files. That includes their EOL convention. Therefore, this: > If not, I would like to suggest a slightly > updated patch that is targeting .el files directly as an exemption: > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index ecb2573cab..19ab0445b9 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -2147,7 +2147,9 @@ package-install-file > (progn > (setq default-directory file) > (dired-mode)) > - (insert-file-contents-literally file) > + (if (string-match "\\.el\\'" file) > + (insert-file-contents file) > + (insert-file-contents-literally file)) > (when (string-match "\\.tar\\'" file) (tar-mode))) > (package-install-from-buffer))) is not something I can endorse, especially as it decodes much more than just the EOL format. From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 15:41:57 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 19:41:57 +0000 Received: from localhost ([127.0.0.1]:48326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldeS5-0004Rz-F7 for submit@debbugs.gnu.org; Mon, 03 May 2021 15:41:57 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldeS3-0004Rt-NZ for 48137@debbugs.gnu.org; Mon, 03 May 2021 15:41:56 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6DC8F809E6; Mon, 3 May 2021 15:41:50 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E82EC80462; Mon, 3 May 2021 15:41:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620070908; bh=kWGt9qb+4ULFvGuNJrEr499Kuu1VTnFYdI1r0Vw+WMw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ZkFbWHlRAkEe+xVCJYFB/czMhKvuZ7s6Znc8HuSAyIgue5P5NCS9R0fIIXlXSPKag bzQmQWQVZNxQXf4uc8sRojRjzAsGrtjj4OGCLXztbHFaBuU89XZVwurSAgR7Y598oQ eUNzFtov5re49Zl25x0Cnr2vYfDQa3gX0U6rOZ/eBaf0ks8j7VNF8BaxbFhl/ZJxhT UrV4b85Xil1OY1Jg+RpKuBoNFtlpEDIgTuGcm4YnGgLk1ncd8BJMoZsOJpk+nLKjYA s0NWH9WV7+gUSoepxTI0xR+lCGR1aMX+eem/DoR3JxaJ7td4TcUKAsFO6yr1suuJZ4 0IOQNXOXP8wpg== Received: from alfajor (unknown [108.161.125.61]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B5AFB120192; Mon, 3 May 2021 15:41:48 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> Date: Mon, 03 May 2021 15:41:47 -0400 In-Reply-To: <83tunj651i.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 03 May 2021 21:33:29 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.033 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I think it's wrong for package.el to try to decode these files. It > should deliver the files to the disk exactly as they are received > through the wire. And the only safe way of doing that is to treat > these files as raw bytes. I'm not sure what you're referring to here. In the OP's case, i.e. `package-install-file` (which is a seldom used functionality, not part of the "normal" `package-install`) the file doesn't go through the wire: it's already "local" and we currently implement this code on top of `package-install-from-buffer`, so it has to work correctly with an already-decoded buffer. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 16:12:26 2021 Received: (at 48137) by debbugs.gnu.org; 3 May 2021 20:12:26 +0000 Received: from localhost ([127.0.0.1]:48460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldeva-0004jM-Ge for submit@debbugs.gnu.org; Mon, 03 May 2021 16:12:26 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldevZ-0004j7-2u for 48137@debbugs.gnu.org; Mon, 03 May 2021 16:12:25 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9D72F440818; Mon, 3 May 2021 16:12:19 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 604484407DF; Mon, 3 May 2021 16:12:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620072738; bh=WzXytOVbf2TdUzM+JGd1aWhu8tShK3fcN1ujUi6ad4w=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=eILV/fgZ5c8ThHO/9NyrHN4j6j4DAPj+B0WGP9jnjvQ4v225spqmN5DQcvDYkp/dc ivk85QPSp7Bdwqu7BnirvdQYyu3jO6Z0Bo3usvDrEcyb/9KFUmEhZqwxAtmf7h67hK 8t+xM7xT2iAxuYVhjb7uCXbDDxuf13Axqu2OLHfZs01+I9ExWSuPNHaUmiYCtBSzzs hUHZeB0AG5ANwF0yLzYZI+pfLVWEPtvyXE+p+55G/Cf8wdO9+ARmPBANXF817vSSmx fp217mS2rJijgPmIMAhQXmDN8y5pH5jTPZ30Wa+3CL3FEJaQYrXAc9jpmAv3Yf4TYQ e2EhBlTAI/uRg== Received: from alfajor (unknown [108.161.125.61]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 30DE2120267; Mon, 3 May 2021 16:12:18 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83r1in645l.fsf@gnu.org> Date: Mon, 03 May 2021 16:12:17 -0400 In-Reply-To: <83r1in645l.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 03 May 2021 21:52:38 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.140 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: Ioannis Kappas , 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> If not, I would like to suggest a slightly >> updated patch that is targeting .el files directly as an exemption: >> >> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el >> index ecb2573cab..19ab0445b9 100644 >> --- a/lisp/emacs-lisp/package.el >> +++ b/lisp/emacs-lisp/package.el >> @@ -2147,7 +2147,9 @@ package-install-file >> (progn >> (setq default-directory file) >> (dired-mode)) >> - (insert-file-contents-literally file) >> + (if (string-match "\\.el\\'" file) >> + (insert-file-contents file) >> + (insert-file-contents-literally file)) >> (when (string-match "\\.tar\\'" file) (tar-mode))) >> (package-install-from-buffer))) > > is not something I can endorse, especially as it decodes much more > than just the EOL format. package.el should do *some* decoding because it needs to look at the pseudo-headers in the file to generate the `-pkg.el` which contains among other things the package's short description. Admittedly, these will usually work OK in undecoded buffers as well, but not in all cases. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 07:35:24 2021 Received: (at 48137) by debbugs.gnu.org; 4 May 2021 11:35:24 +0000 Received: from localhost ([127.0.0.1]:52683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldtKm-0004Y3-0R for submit@debbugs.gnu.org; Tue, 04 May 2021 07:35:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldtKk-0004Xx-0S for 48137@debbugs.gnu.org; Tue, 04 May 2021 07:35:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49540) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldtKe-00069p-BT; Tue, 04 May 2021 07:35:16 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3789 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldtKN-0002q8-VF; Tue, 04 May 2021 07:35:01 -0400 Date: Tue, 04 May 2021 14:34:45 +0300 Message-Id: <83lf8u68bu.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Mon, 03 May 2021 15:41:47 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org > Date: Mon, 03 May 2021 15:41:47 -0400 > > > I think it's wrong for package.el to try to decode these files. It > > should deliver the files to the disk exactly as they are received > > through the wire. And the only safe way of doing that is to treat > > these files as raw bytes. > > I'm not sure what you're referring to here. To the suggestion to decode *.el files by package.el as part of the installation. > In the OP's case, i.e. `package-install-file` (which is a seldom used > functionality, not part of the "normal" `package-install`) the file doesn't go > through the wire: it's already "local" and we currently implement this > code on top of `package-install-from-buffer`, so it has to work > correctly with an already-decoded buffer. If this works with buffer text, then how are DOS EOLs come into play here? There are no CRLF pairs in decoded buffer text. From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 07:39:41 2021 Received: (at 48137) by debbugs.gnu.org; 4 May 2021 11:39:41 +0000 Received: from localhost ([127.0.0.1]:52707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldtOm-0004ag-OD for submit@debbugs.gnu.org; Tue, 04 May 2021 07:39:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldtOj-0004aa-WE for 48137@debbugs.gnu.org; Tue, 04 May 2021 07:39:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49614) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldtOd-00006a-Hh; Tue, 04 May 2021 07:39:24 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4052 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldtOV-00074K-FO; Tue, 04 May 2021 07:39:22 -0400 Date: Tue, 04 May 2021 14:39:02 +0300 Message-Id: <83im3y684p.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Mon, 03 May 2021 16:12:17 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83r1in645l.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Stefan Monnier > Cc: Ioannis Kappas , 48137@debbugs.gnu.org > Date: Mon, 03 May 2021 16:12:17 -0400 > > >> If not, I would like to suggest a slightly > >> updated patch that is targeting .el files directly as an exemption: > >> > >> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > >> index ecb2573cab..19ab0445b9 100644 > >> --- a/lisp/emacs-lisp/package.el > >> +++ b/lisp/emacs-lisp/package.el > >> @@ -2147,7 +2147,9 @@ package-install-file > >> (progn > >> (setq default-directory file) > >> (dired-mode)) > >> - (insert-file-contents-literally file) > >> + (if (string-match "\\.el\\'" file) > >> + (insert-file-contents file) > >> + (insert-file-contents-literally file)) > >> (when (string-match "\\.tar\\'" file) (tar-mode))) > >> (package-install-from-buffer))) > > > > is not something I can endorse, especially as it decodes much more > > than just the EOL format. > > package.el should do *some* decoding because it needs to look at > the pseudo-headers in the file to generate the `-pkg.el` which > contains among other things the package's short description. That's not "decoding" in the sense I used it, which is when we _replace_ in memory the original raw bytes with the decoded contents. "Decoding" for the purpose of parsing some part of the file is fine, especially since here it just needs to be prepared to having an optional CR before each LF. (In fact, I'd be also okay with decoding all of it into a temporary buffer, though that would probably be waste of cycles.) > Admittedly, these will usually work OK in undecoded buffers as well, > but not in all cases. In what cases this would not work? Can those cases be handled by directing the decoded stuff to a destination that is not the original text, thus keeping the original text unaltered? From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 11:58:04 2021 Received: (at 48137) by debbugs.gnu.org; 4 May 2021 15:58:05 +0000 Received: from localhost ([127.0.0.1]:53970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldxQy-0002sa-L3 for submit@debbugs.gnu.org; Tue, 04 May 2021 11:58:04 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldxQv-0002sC-G9 for 48137@debbugs.gnu.org; Tue, 04 May 2021 11:58:03 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2CD824410E1; Tue, 4 May 2021 11:57:56 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 99BE24410D5; Tue, 4 May 2021 11:57:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620143874; bh=cdXTMJvrce7QI5pX3494RuoS6p1HCYZoDyy8rPqbelk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FMEhupZ9l2FwT/pJ6PkqIRNtIvEKc52+21dhhMB8t3TwUANF46MGndFv6f6qbQI3H q/a5samClpZKToLmHY/lky+sJgmfAZVwUdybq137M7LVDDD0i1KvHHQ+m4OA2BFU5F vfNX8eqoAAeIH8UR49bQbVnVCDIAK3fZbGJvWQ3O2BTDpN8p0CLhYqKfKZxZACCTPP 4EzR0gRsOi92nqirk28aqy09kpRel3KYbePE6hHl6ZM6sjuILhQuhv+vHfyeMv6kal mrK2MWUssghwpJ8nWPUIUGK2pCU0d7YoAgmMqCdRyaPP1C6V7Es6mY5xADMwMABb/p +syZXaS4Zz2ug== Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 64928120677; Tue, 4 May 2021 11:57:54 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> Date: Tue, 04 May 2021 11:57:53 -0400 In-Reply-To: <83lf8u68bu.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 May 2021 14:34:45 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.080 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > I think it's wrong for package.el to try to decode these files. It >> > should deliver the files to the disk exactly as they are received >> > through the wire. And the only safe way of doing that is to treat >> > these files as raw bytes. >> I'm not sure what you're referring to here. > To the suggestion to decode *.el files by package.el as part of the > installation. Even for `package-install-file`? [ which is a completely different code path than `package-install`. It's a kind of "side feature" to install packages using `package.el` without using an ELPArchive. ] >> In the OP's case, i.e. `package-install-file` (which is a seldom used >> functionality, not part of the "normal" `package-install`) the file doesn't go >> through the wire: it's already "local" and we currently implement this >> code on top of `package-install-from-buffer`, so it has to work >> correctly with an already-decoded buffer. > If this works with buffer text, then how are DOS EOLs come into play > here? There are no CRLF pairs in decoded buffer text. `package-install-file` takes a file, not a buffer, as input. But internally it works by calling `package-install-from-buffer`. Taking a step back, I think I'm just failing to understand why you insist on not decoding the `.el` file. What `package-install-file` will do is extract `-pkg.el` from it, save a copy of the file somehow to `~/.emacs.d/elpa//.el` and then compile it. After that, the file (neither the original file, nor its copy in `~/.emacs.d/elpa//.el`) will basically never be used any more. So the only "significant" uses of this file are extraction of data for `-pkg.el` and byte-compilation, both of which work on the decoded version of the file. Furthermore, `insert-file-contents + write-region` should(!) preserve the bytes in all normal cases. I agree that in principle it would be better to copy the file by copying its bytes than by `insert-file-contents + write-region`. [ BTW, we have a bug in `package-install-from-buffer` currently for buffers which contain non-ASCII chars (because it saves the buffer's content via `package-unpack` => `package--write-file-no-coding`), so if we do go ahead with the change Ioannis proposes (which I think is acceptable) we definitely need to fix that bug in `package-install-from-buffer`. ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 12:14:51 2021 Received: (at 48137) by debbugs.gnu.org; 4 May 2021 16:14:51 +0000 Received: from localhost ([127.0.0.1]:54068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldxh9-000348-CF for submit@debbugs.gnu.org; Tue, 04 May 2021 12:14:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldxh4-000342-OG for 48137@debbugs.gnu.org; Tue, 04 May 2021 12:14:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55094) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldxgz-0005rM-6q; Tue, 04 May 2021 12:14:37 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1043 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldxgx-0001ML-4z; Tue, 04 May 2021 12:14:36 -0400 Date: Tue, 04 May 2021 19:14:20 +0300 Message-Id: <83mtta4gtf.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 04 May 2021 11:57:53 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) > From: Stefan Monnier > Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org > Date: Tue, 04 May 2021 11:57:53 -0400 > > >> I'm not sure what you're referring to here. > > To the suggestion to decode *.el files by package.el as part of the > > installation. > > Even for `package-install-file`? Yes, why not? How else can we ensure 100% that the installed file will be identical to the original one? > > If this works with buffer text, then how are DOS EOLs come into play > > here? There are no CRLF pairs in decoded buffer text. > > `package-install-file` takes a file, not a buffer, as input. > But internally it works by calling `package-install-from-buffer`. Then at some point we do insert the file into a buffer. I'm saying that we should insert it literally. > What `package-install-file` will do is extract `-pkg.el` from it, ^^^^^^^ What is "it" in "from it" there? > save a copy of the file somehow to `~/.emacs.d/elpa//.el` and > then compile it. After that, the file (neither the original file, nor > its copy in `~/.emacs.d/elpa//.el`) will basically never be > used any more. So the only "significant" uses of this file are > extraction of data for `-pkg.el` and byte-compilation, both of > which work on the decoded version of the file. I'm saying that extraction should not decode it. Byte compilation will do its usual thing, but that's not what I was talking about. > Furthermore, `insert-file-contents + write-region` should(!) preserve > the bytes in all normal cases. Yes, but that's not 100% guaranteed. It can fail. the only way not to fail is not to decode (and then not to encode). > I agree that in principle it would be better to copy the file by copying > its bytes than by `insert-file-contents + write-region`. Why only "in principle"? what prevents us from actually doing that? From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 12:27:48 2021 Received: (at 48137) by debbugs.gnu.org; 4 May 2021 16:27:48 +0000 Received: from localhost ([127.0.0.1]:54134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldxtk-0003Bl-GC for submit@debbugs.gnu.org; Tue, 04 May 2021 12:27:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldxth-0003Bf-DI for 48137@debbugs.gnu.org; Tue, 04 May 2021 12:27:47 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 17661805BE; Tue, 4 May 2021 12:27:40 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8811680533; Tue, 4 May 2021 12:27:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620145658; bh=90Yo3+6C/QGZbZnNCk0oy6M24rFcK1uO24lbc0bPGss=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=BemDniiRGkopfzErLMdZb6DJvnvy17MXxBdG0Qt+o63E8nSp//tsbzTpPTthSp199 +mwpUwuX8+970JR1Pp0RUaDH9oES5RC6aiTekf96vEuwZqGIbFu+JOcXL7cRRQQWSc GmBzjYcTqz+Di3Mc0VYnNSgLvP9D02nPaB5aiVo7qyjjyYVkRdMfyTlDgdPQISyv+q HvxiOQds3xh2aAqkLPfAdqMrQrVjJ1u1yqMlzLzkfPdC117UXW2s4ZgnyFh603t1i5 XTGUOoTkKKgOft3m8ogkzg59UcWh+CBxGz3rOsZ7YX5675r1CCM+RapzA3pW8jI/7D LSAjqPw+hoZqA== Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 58C5A120970; Tue, 4 May 2021 12:27:38 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> Date: Tue, 04 May 2021 12:27:37 -0400 In-Reply-To: <83mtta4gtf.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 May 2021 19:14:20 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.014 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I agree that in principle it would be better to copy the file by copying >> its bytes than by `insert-file-contents + write-region`. > Why only "in principle"? what prevents us from actually doing that? Someone willing to take the time and rework the code accordingly? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 12:52:15 2021 Received: (at 48137) by debbugs.gnu.org; 4 May 2021 16:52:15 +0000 Received: from localhost ([127.0.0.1]:54279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldyHP-0003RZ-4Q for submit@debbugs.gnu.org; Tue, 04 May 2021 12:52:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldyHN-0003RT-J0 for 48137@debbugs.gnu.org; Tue, 04 May 2021 12:52:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55828) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldyHH-0005Og-TD; Tue, 04 May 2021 12:52:07 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3357 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldyHC-0006sb-OG; Tue, 04 May 2021 12:52:07 -0400 Date: Tue, 04 May 2021 19:51:50 +0300 Message-Id: <83fsz24f2x.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 04 May 2021 12:27:37 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org > Date: Tue, 04 May 2021 12:27:37 -0400 > > >> I agree that in principle it would be better to copy the file by copying > >> its bytes than by `insert-file-contents + write-region`. > > Why only "in principle"? what prevents us from actually doing that? > > Someone willing to take the time and rework the code accordingly? I thought that's Ioannis? From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 03:03:45 2021 Received: (at 48137) by debbugs.gnu.org; 5 May 2021 07:03:45 +0000 Received: from localhost ([127.0.0.1]:58124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leBZR-0004NQ-4D for submit@debbugs.gnu.org; Wed, 05 May 2021 03:03:45 -0400 Received: from mail-ot1-f46.google.com ([209.85.210.46]:42847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leBZC-0004NJ-CG for 48137@debbugs.gnu.org; Wed, 05 May 2021 03:03:44 -0400 Received: by mail-ot1-f46.google.com with SMTP id g15-20020a9d128f0000b02902a7d7a7bb6eso844045otg.9 for <48137@debbugs.gnu.org>; Wed, 05 May 2021 00:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fyBVRY6T3B6aGGU4F2kWRj5X695bauNehWFaJkx3sts=; b=qwtaBUpoHph7lBVKnlXHqz9yC6dy71bXaJcF6mpSJwVKMdIMXWZSaX5ayZEtKTBHDb ZuDQEUoOd/hfQ95jlU+zjkTL1bIvK72TXXRHMUXLsLXRKe/hbG3LodH3oA+9/lYZ+2CS PzEHi2XXVf3c3B3DVazn7lYbhg77zOjjQpCoLwZHjciwfCU+l7SK6kipJ3lkJORySpJm ywTZIHxZTuT2IajWqcQ7vmWPv7RLAkkZkKpAetOiMzoPk6tKKmsfZsGVeajgyQ9GTCWh yYO4AdPk/Y8aFwMkaHltj0akctyQ+QXKzISiBTalY9tzTWXdhxA3CDVI2DL3YIUCNCrk kNQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fyBVRY6T3B6aGGU4F2kWRj5X695bauNehWFaJkx3sts=; b=NO2qJi7QU78JPpU4ZlMZ+p2lM6QBlsinC9Lg+u/oxyh1CyhmBFRX6mBHKLH4QpXb6T rx3XPAmd8iyJBOCHvJ+U5PcFk+CEj6Skb7Wz17dqmnNBRZOgt3/b/QuiKHy7KWiPQud7 0jdY3ZgvgtAXUbxUX3wI3Dtqie/37+I60ZH7kjrCUaR06vaNNTNgLmUcd1XmXg0SMlBs 0DuICNusJx7GIzXAV6wuyT1oQEFtn4xNUp5v+MzNy5z7sLOh6tuygNvAiBlosNdwc/ao PPSAjdy377jISz6pYfe0ecyaO/hEfizMwpUtXfoaJWI1SwBiiYtG+ATzzjcDVAG9zF/z TC1w== X-Gm-Message-State: AOAM532laFXLE0EFjPMaiM4rFfoKK4d2ewvAwrc9t4G0ae2oURy/F9rc Xx958USmdOK95eZW9efwC96jFEmSEmcb1u6N2FE= X-Google-Smtp-Source: ABdhPJxCS8NpreKY+XS0RELdZ9YiNqEDlP3R/JLtqvZyGSugjy8pdH32LSGlibqj7U27YjGHi/MxRf5Yb0ixtesvbYY= X-Received: by 2002:a9d:2de1:: with SMTP id g88mr23782355otb.5.1620198204719; Wed, 05 May 2021 00:03:24 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> In-Reply-To: <83fsz24f2x.fsf@gnu.org> From: Ioannis Kappas Date: Wed, 5 May 2021 08:03:17 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, May 4, 2021 at 5:52 PM Eli Zaretskii wrote: > > > From: Stefan Monnier > > Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org > > Date: Tue, 04 May 2021 12:27:37 -0400 > > > > >> I agree that in principle it would be better to copy the file by copying > > >> its bytes than by `insert-file-contents + write-region`. > > > Why only "in principle"? what prevents us from actually doing that? > > > > Someone willing to take the time and rework the code accordingly? > > I thought that's Ioannis? I can have a look. Currently, `package-install-file' reads the package contents into a buffer and calls `package-install-from-buffer' to parse the headers, download & install its dependencies, and finally install the package itself from the buffer. Just to confirm, what we are discussing as a solution (at a high level) is to parse the package headers from a decoded buffer, download & install its dependencies, and copy/extract the package file to the elpa user dir? Thanks From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 08:02:04 2021 Received: (at 48137) by debbugs.gnu.org; 5 May 2021 12:02:04 +0000 Received: from localhost ([127.0.0.1]:59720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leGE8-0002X0-Cp for submit@debbugs.gnu.org; Wed, 05 May 2021 08:02:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leGE4-0002Wb-1D for 48137@debbugs.gnu.org; Wed, 05 May 2021 08:02:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42688) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leGDy-0005wH-G6; Wed, 05 May 2021 08:01:54 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2342 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1leGDu-0005rV-Sp; Wed, 05 May 2021 08:01:51 -0400 Date: Wed, 05 May 2021 15:01:37 +0300 Message-Id: <83v97x2xum.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Wed, 5 May 2021 08:03:17 +0100) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Wed, 5 May 2021 08:03:17 +0100 > Cc: Stefan Monnier , 48137@debbugs.gnu.org > > Currently, `package-install-file' reads the package contents into a > buffer and calls `package-install-from-buffer' to parse the headers, > download & install its dependencies, and finally install the package > itself from the buffer. > > Just to confirm, what we are discussing as a solution (at a high > level) is to parse the package headers from a decoded buffer, download > & install its dependencies, and copy/extract the package file to the > elpa user dir? My idea was to read the file literally, without decoding, then parse the package headers from that. Stefan seems to think it's non-trivial, which makes me suspect that I'm missing something. From debbugs-submit-bounces@debbugs.gnu.org Thu May 06 02:56:14 2021 Received: (at 48137) by debbugs.gnu.org; 6 May 2021 06:56:14 +0000 Received: from localhost ([127.0.0.1]:36874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leXvh-0001aj-2f for submit@debbugs.gnu.org; Thu, 06 May 2021 02:56:14 -0400 Received: from mail-ot1-f45.google.com ([209.85.210.45]:37787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leXvb-0001ad-Sj for 48137@debbugs.gnu.org; Thu, 06 May 2021 02:56:11 -0400 Received: by mail-ot1-f45.google.com with SMTP id c8-20020a9d78480000b0290289e9d1b7bcso4035403otm.4 for <48137@debbugs.gnu.org>; Wed, 05 May 2021 23:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0pUoE8IrHwnxh31MJikoHMgWyVdZiuYEacWoY3zfA0E=; b=NSRY/TQAPZsQAvTpOYDhlRZIpQY5NOGLzI9KEOD47ufPyC49utOBNoic+VWzSwBxoq Pm9Kp40/cgQrQD/mNeJC9Zfp/zj0hX+cIpScRC7YEQ5qNB9DuQtgUy9cuqG15+awKdlQ llmq5kKyzYBUd6NNRSQXBme0w7O2NIKVYYf9NCo8XN7n7LB8kuxzsPF2zueGtPp9WTKO lgOqokbSVJj1V8xBmwQXXE1kZ3UH2NCKbmAMd/fWlEvCES1PsEQoqh5fsgZoqESOGU83 TOA60yYMjWdAjsD09LqGqhYvUSskb1pvZiABKCRNwfEKru49RA2f41smlr1ZoNwaAChI rL8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0pUoE8IrHwnxh31MJikoHMgWyVdZiuYEacWoY3zfA0E=; b=WG1vTXv8O+atJkiLXzVo/v5gzy8t+UWVF7U48cdzTRj4y7Y0n8Z25py0+jCWlLSS9s U4fjhcVMd3QiMhyMagLe691dAT/UlERWdR9pz3E95jg0xSalGz3Y5iIH3CZSvETN8hIO FfDKGIXpa5yIU0WTjHA/U8WuhMZsDBXtN/aHwDxXu4hW0OeRmGJP9HyiRkY/W0lHnWfa Yp9Lw19sm5Oqcb13tLF/H5JYRn9UlzPGf9BGZ61uO5u8EyPNtWwjsmtmfTmsTQlqpw8a RoByN2NHmPxLRXAF5Gutb/1RcHGt1wX5nEHc8ZXdDvHnkfxnoxIouzfTZiML+CQDSDMN sHyg== X-Gm-Message-State: AOAM5331UVKDU24PnuqemostI5JWXwqxbw/zDOUkSr6jSyUZk2IUEQHj cBH41Ik64P04mBcBQrXg+/Xzl0zps+1bYFiNPvk= X-Google-Smtp-Source: ABdhPJzisA51bUhPjMn4sSIzM2fkmLY+OomlXZ0f5YblWXPVedQywYcVZzeTZrpm/Y+7F8/oxxg7hoUyVWmVLxuFymk= X-Received: by 2002:a9d:2de1:: with SMTP id g88mr2419128otb.5.1620284162179; Wed, 05 May 2021 23:56:02 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> In-Reply-To: From: Ioannis Kappas Date: Thu, 6 May 2021 07:55:52 +0100 Message-ID: Subject: RE: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, May 5, 2021 at 1:01 PM Eli Zaretskii wrote: > > > From: Ioannis Kappas > > Date: Wed, 5 May 2021 08:03:17 +0100 > > Cc: Stefan Monnier , 48137@debbugs.gnu.org > > > > Currently, `package-install-file' reads the package contents into a > > buffer and calls `package-install-from-buffer' to parse the headers, > > download & install its dependencies, and finally install the package > > itself from the buffer. > > > > Just to confirm, what we are discussing as a solution (at a high > > level) is to parse the package headers from a decoded buffer, download > > & install its dependencies, and copy/extract the package file to the > > elpa user dir? > > My idea was to read the file literally, without decoding, then parse > the package headers from that. I suppose you mean something along the other option below? > > > Another solution could be to upgrade the 'lisp-mnt package to ignore > > ?\r characters. Looking at the `lm-header' fn invoked by > > `package-buffer-info', it does have a list of characters to stop at > > when looking for a header, we can thus add the carriage return to the > > list: > > > > diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el > > index 9cba232e16..3eb493d286 100644 > > --- a/lisp/emacs-lisp/lisp-mnt.el > > +++ b/lisp/emacs-lisp/lisp-mnt.el > > @@ -267,7 +267,7 @@ lm-header > > (if (save-excursion > > (skip-chars-backward "^$" (match-beginning 0)) > > (= (point) (match-beginning 0))) > > - "[^\n]+" "[^$\n]+"))) > > + "[^\n\r]+" "[^$\n\r]+"))) > > This is better, but IMO the code should be rewritten not to allow a > lone CR character, only either a lone LF or the CRLF pair. Thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 06 04:12:54 2021 Received: (at 48137) by debbugs.gnu.org; 6 May 2021 08:12:54 +0000 Received: from localhost ([127.0.0.1]:36984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leZ7m-0002Xa-Ev for submit@debbugs.gnu.org; Thu, 06 May 2021 04:12:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leZ7j-0002XU-P1 for 48137@debbugs.gnu.org; Thu, 06 May 2021 04:12:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49934) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leZ7e-0003Cn-JX; Thu, 06 May 2021 04:12:38 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3178 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1leZ7c-0001Y4-Vh; Thu, 06 May 2021 04:12:37 -0400 Date: Thu, 06 May 2021 11:12:26 +0300 Message-Id: <83wnsce0wl.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Thu, 6 May 2021 07:55:52 +0100) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Thu, 6 May 2021 07:55:52 +0100 > Cc: Stefan Monnier , 48137@debbugs.gnu.org > > > My idea was to read the file literally, without decoding, then parse > > the package headers from that. > > I suppose you mean something along the other option below? It could be, but as I said up-thread, this specific change allows a lone \r to be taken as an end of line, which I think is wrong. We should only support a single \n or a \r\n pair. See this comment I made back then: > > > - "[^\n]+" "[^$\n]+"))) > > > + "[^\n\r]+" "[^$\n\r]+"))) > > > > This is better, but IMO the code should be rewritten not to allow a > > lone CR character, only either a lone LF or the CRLF pair. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu May 06 09:27:48 2021 Received: (at 48137) by debbugs.gnu.org; 6 May 2021 13:27:48 +0000 Received: from localhost ([127.0.0.1]:37544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lee2e-0000bi-Bs for submit@debbugs.gnu.org; Thu, 06 May 2021 09:27:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lee2c-0000ba-Iu for 48137@debbugs.gnu.org; Thu, 06 May 2021 09:27:47 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 55FF4440943; Thu, 6 May 2021 09:27:40 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DBD954408C9; Thu, 6 May 2021 09:27:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620307658; bh=hah2WwDhJECCOeAaCjKm6WUk6DyQDj8Dy+7I1uxDxFI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VWMlBMTlLZLqU2bcU1eGQNDLNsmYDrb8JVNDRbsN7+VKF6+wRhmYouxnHhIJkb/hx hOYjJ2lZAYnYzWR/IGzb1Aw1vRv8wOnqffTHGEu7aNZFVv9NOAl7CAX3sy4CDEuQF0 T86WK/T7cgIQJv7QBolf3fBHIO8zomhTXva3kiRVuqbf480Ft9fpRVtZaHa3BjpmeI lTTzxikqF+ETSprazw0jnK8ruxP6djR4Ky2xSD5FL8PZY+Z2XcpxfGKET52aQ5qnzX GW9iImYTFai0SnBspQplB2zHANPZ88WNkMSV/RXOr5KSK3QaU6k0wUOTZr1psoWnjD 7nmKnHEcdTxcw== Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AE1FE120328; Thu, 6 May 2021 09:27:38 -0400 (EDT) From: Stefan Monnier To: Ioannis Kappas Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> Date: Thu, 06 May 2021 09:27:38 -0400 In-Reply-To: (Ioannis Kappas's message of "Thu, 6 May 2021 07:55:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.087 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: Eli Zaretskii , 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> My idea was to read the file literally, without decoding, then parse >> the package headers from that. > I suppose you mean something along the other option below? That's not sufficient, because if we don't decode the file before we call `package-buffer-info` (from `package-install-from-buffer`), then the -pkg.el file will have incorrect content (e.g. the non-ASCII chars in the description of the package, will be later incorrectly displayed in `list-packages`). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu May 06 11:27:06 2021 Received: (at 48137) by debbugs.gnu.org; 6 May 2021 15:27:06 +0000 Received: from localhost ([127.0.0.1]:38102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lefu6-0001tH-5f for submit@debbugs.gnu.org; Thu, 06 May 2021 11:27:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lefu4-0001sY-76 for 48137@debbugs.gnu.org; Thu, 06 May 2021 11:27:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44602) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lefty-0003FN-IN; Thu, 06 May 2021 11:26:58 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2284 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1lefty-0001BZ-4r; Thu, 06 May 2021 11:26:58 -0400 Date: Thu, 06 May 2021 18:26:48 +0300 Message-Id: <83bl9nevd3.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Thu, 06 May 2021 09:27:38 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 48137@debbugs.gnu.org > Date: Thu, 06 May 2021 09:27:38 -0400 > > That's not sufficient, because if we don't decode the file before we > call `package-buffer-info` (from `package-install-from-buffer`), then > the -pkg.el file will have incorrect content (e.g. the non-ASCII > chars in the description of the package, will be later incorrectly > displayed in `list-packages`). So you are saying the description of the package needs to be decoded before using it for list-packages? That'd be okay; all I care about is that the decoded stuff does NOT replace the original raw bytes, but instead is used only where decoding is needed. IOW, decoding should either be done on substrings of the original file, and the result stored in strings, or the decoded stuff should be placed in a separate scratch buffer, which will be used only where decoding is really needed. From debbugs-submit-bounces@debbugs.gnu.org Tue May 11 02:52:19 2021 Received: (at 48137) by debbugs.gnu.org; 11 May 2021 06:52:19 +0000 Received: from localhost ([127.0.0.1]:34833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgMFf-0007Xa-7t for submit@debbugs.gnu.org; Tue, 11 May 2021 02:52:19 -0400 Received: from mail-ot1-f42.google.com ([209.85.210.42]:36810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgMFe-0007XO-2I for 48137@debbugs.gnu.org; Tue, 11 May 2021 02:52:18 -0400 Received: by mail-ot1-f42.google.com with SMTP id n32-20020a9d1ea30000b02902a53d6ad4bdso16658066otn.3 for <48137@debbugs.gnu.org>; Mon, 10 May 2021 23:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IrlopOLAC8wL9MtUFkA86gYz6aoVDcVCuUMiiL34/R8=; b=sZj10WdTxb5XtYtIwU3EhuebshRDgFNFmCXf0odnZd/7uDKJGktKgHAECpaIYzPtFG DJ4MQkNECDG2pDEB/6h2V/aZwjzjA/5hz6oXWB6CMk8eW3y8Gw/cMd5KHdLyiGMNojW8 WKc2rEFissJAsBkNyF5FmAtiAxLrHrQBk/0Pi8kvhDJNyhjcasSeBrLHuiZ65n5PSJjh SfhQOq1Ct8BDc24gtKexEdzx3O1vgSXqHaALTuoVYGnILcAEwXy3DuZ8b8OMPLfg7Ck/ +BSxQEFlPTWjw+TVn/7k+8yLEyNGj5j8n5ZkPvL+xJlYM3fwOVlLmDiyWqRrCVJ2qMNC CcdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IrlopOLAC8wL9MtUFkA86gYz6aoVDcVCuUMiiL34/R8=; b=roLexPq4nDl1WkkJ9h8YXRh68+lakdF4AFBQdEcmrOGNRoyrY3UvVe6cYG8kiLDnbA cqTyWqP3MgiOHdyr6LLMmX2GgzINnfF28IjLze++GW57no+Rx8p0zGdIJliYrgPFUFa0 yJputU+rxztBp5QTgpc2vBkls/fJ6UXn157iEV7v8yO4Z+FpYNKa3TQo5pmEgQc8L7CX 4N3QKQdvFUhuBoPH4DLvTdU6aMmgmobwdWEBnDKMrxGBTABoS0gPBpOxpDGdPnpiPjWj egwU5svkmtIrLL9JrJi922KaC8ken1AoUsO5iM9oez8K48NwH8RGbaSfiB5TVKVwBBBE MrpA== X-Gm-Message-State: AOAM533Dq/dDM6qGoUPJHx5zTcIxJQKPqNUmhplnxaIxdlzyUR2jUo6m H6xR6mmH8lMB1XiRVBiAom2XnVYgXGq5LWM50iw= X-Google-Smtp-Source: ABdhPJwmdubQm5+zT4WoLhej0nq0ueki+YVYqlj3hDwRdiUruzSFRi5RTWVoX1/01Hb1JsMGNMAbhGjGEFQiKqAq8Fs= X-Received: by 2002:a9d:7e91:: with SMTP id m17mr24469920otp.192.1620715932360; Mon, 10 May 2021 23:52:12 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> In-Reply-To: <83bl9nevd3.fsf@gnu.org> From: Ioannis Kappas Date: Tue, 11 May 2021 07:52:02 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, May 6, 2021 at 4:26 PM Eli Zaretskii wrote: > > > From: Stefan Monnier > > Cc: Eli Zaretskii , 48137@debbugs.gnu.org > > Date: Thu, 06 May 2021 09:27:38 -0400 > > > > That's not sufficient, because if we don't decode the file before we > > call `package-buffer-info` (from `package-install-from-buffer`), then > > the -pkg.el file will have incorrect content (e.g. the non-ASCII > > chars in the description of the package, will be later incorrectly > > displayed in `list-packages`). > > So you are saying the description of the package needs to be decoded > before using it for list-packages? That'd be okay; all I care about > is that the decoded stuff does NOT replace the original raw bytes, but > instead is used only where decoding is needed. IOW, decoding should > either be done on substrings of the original file, and the result > stored in strings, or the decoded stuff should be placed in a separate > scratch buffer, which will be used only where decoding is really > needed. Is loading with `insert-file-contents' and saving as 'raw-text the same as copying the raw bytes of the original file? `hexlify-buffer' in 'hexl uses 'raw-text to display the raw bytes of an encoded buffer. I always assumed hexl displayed the actual binary representation of the underlying file. In which case, having `package-install-file' load the .el package file metaphorically and modifying `package-unpack' to store 'single files with 'raw-text should satisfy the requirement? Thus header parsing is done in the intended coding system, while the end package is a "copy" of the original. Example patch: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ecb2573cab..b5fa020179 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -932,7 +932,7 @@ package-unpack ('single (let ((el-file (expand-file-name (format "%s.el" name) pkg-dir))) (make-directory pkg-dir t) - (package--write-file-no-coding el-file))) + (package--write-file-raw-text el-file))) (kind (error "Unknown package kind: %S" kind))) (package--make-autoloads-and-stuff pkg-desc pkg-dir) ;; Update package-alist. @@ -1180,9 +1180,9 @@ package-dir-info ;; Set of low-level functions for communicating with archives and ;; signature checking. -(defun package--write-file-no-coding (file-name) +(defun package--write-file-raw-text (file-name) "Write file FILE-NAME without encoding using coding system." - (let ((buffer-file-coding-system 'no-conversion)) + (let ((buffer-file-coding-system 'raw-text)) (write-region (point-min) (point-max) file-name nil 'silent))) (declare-function url-http-file-exists-p "url-http" (url)) @@ -2147,7 +2147,9 @@ package-install-file (progn (setq default-directory file) (dired-mode)) - (insert-file-contents-literally file) + (if (string-match "\\.el\\'" file) + (insert-file-contents file) + (insert-file-contents-literally file)) (when (string-match "\\.tar\\'" file) (tar-mode))) (package-install-from-buffer))) Btw, https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-System-Basics.html mentions about the 'no-conversion coding system: no-conversion (and its alias binary) is equivalent to raw-text-unix: it specifies no conversion of either character codes or end-of-line. but since it is -unix, it does do EOL conversions to LF. Should the above be corrected to something like: no-conversion (and its alias binary) is equivalent to raw-text-unix: it specifies no conversion of character codes but converts end-of-lines to the unix convention. Thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 11 08:55:50 2021 Received: (at 48137) by debbugs.gnu.org; 11 May 2021 12:55:50 +0000 Received: from localhost ([127.0.0.1]:35316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgRvS-0001PH-3i for submit@debbugs.gnu.org; Tue, 11 May 2021 08:55:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgRvC-0001OW-6j for 48137@debbugs.gnu.org; Tue, 11 May 2021 08:55:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48088) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgRv6-0005Y4-DS; Tue, 11 May 2021 08:55:28 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1590 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgRv5-0005P6-PE; Tue, 11 May 2021 08:55:28 -0400 Date: Tue, 11 May 2021 15:55:31 +0300 Message-Id: <831rad5t18.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Tue, 11 May 2021 07:52:02 +0100) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Tue, 11 May 2021 07:52:02 +0100 > Cc: Stefan Monnier , 48137@debbugs.gnu.org > > > So you are saying the description of the package needs to be decoded > > before using it for list-packages? That'd be okay; all I care about > > is that the decoded stuff does NOT replace the original raw bytes, but > > instead is used only where decoding is needed. IOW, decoding should > > either be done on substrings of the original file, and the result > > stored in strings, or the decoded stuff should be placed in a separate > > scratch buffer, which will be used only where decoding is really > > needed. > > Is loading with `insert-file-contents' and saving as 'raw-text the > same as copying the raw bytes of the original file? No. You should load with insert-file-contents-literally, and then saving will automatically DTRT. You could also load using raw-text, in which case Emacs will be able to convert EOL. But I don't recommend to do any conversions, including the EOL conversions, because they still can change the contents on saving in some rare cases. > `hexlify-buffer' in 'hexl uses 'raw-text to display the raw bytes of > an encoded buffer. I always assumed hexl displayed the actual binary > representation of the underlying file. It does, indeed. > In which case, having `package-install-file' load the .el package file > metaphorically and modifying `package-unpack' to store 'single files > with 'raw-text should satisfy the requirement? Thus header parsing is > done in the intended coding system, while the end package is a "copy" > of the original. Sorry, you lost me here: I don't think I understand the details of how you intend to do the above. > - (package--write-file-no-coding el-file))) > + (package--write-file-raw-text el-file))) You don't need to force any encoding on write: Emacs by default will use the same encoding as the one used to read the file. > Btw, > https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-System-Basics.html > mentions about the 'no-conversion coding system: > > no-conversion (and its alias binary) is equivalent to raw-text-unix: > it specifies no conversion of either character codes or end-of-line. > > but since it is -unix, it does do EOL conversions to LF. No, -unix means it doesn't convert EOL. IOW, the -unix part means "assume Unix-style LF-only EOLs and don't convert EOL conventions". From debbugs-submit-bounces@debbugs.gnu.org Sat May 15 09:52:56 2021 Received: (at 48137) by debbugs.gnu.org; 15 May 2021 13:52:56 +0000 Received: from localhost ([127.0.0.1]:47890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhuiu-00015V-4p for submit@debbugs.gnu.org; Sat, 15 May 2021 09:52:56 -0400 Received: from mail-oi1-f173.google.com ([209.85.167.173]:34652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhuis-00015H-1G for 48137@debbugs.gnu.org; Sat, 15 May 2021 09:52:54 -0400 Received: by mail-oi1-f173.google.com with SMTP id u11so2259537oiv.1 for <48137@debbugs.gnu.org>; Sat, 15 May 2021 06:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jw3d+NjfJwGeLszhB5MbnFNYZBz/ZtnU4Wm/ZTSGmyU=; b=Ln1OLpojZahKsPa5iRyiqeju95i15mQRKcqY8EDTfJazUNWUBgqwifWJJc4+9I4g9h NiW9CZVqiuNuNtt5xuB09xcvOzmYWGjvRHhD/7brmzS5y1L4gb7X20Fl7cNMmAhIskjc 1Okpan43/azJd9Z4fRDJ98Y9tfhqBCExKPTcoHiTt4Xq7FC8jdakdmY2h8nG77E/8N1P /yosiwEz+kYfon5qTnT6OnZ3la9UVlFxX1vRaeQ0/kUOqvtLBvXcmIhc5EXO4ohMDpQG 6zHxcPYhCJbFMO927MTmlCVTi377bHaOlGd0zBIdxl4WxAzA5jeOP48Mnt0WjfZoDuIm NtMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jw3d+NjfJwGeLszhB5MbnFNYZBz/ZtnU4Wm/ZTSGmyU=; b=QmoAmkrGqk9+9iMJ12iNIU7sZMVDNM2AIhsRY4Hj+TNRu+z6PYC1GVY1J1RjUE6Fwp i8tqP2TyHLR7A/ITFIQMKwUVfp5KLcBGpA5GJdz7dzZF/rA15jsMpHuYhuAEHykiE/KI ZlnI/ihzYM1Fb3GAPGMdXm7C1IbvyQVfDT8xi9vJ+bt9zdBxCSeacLLsCVlqVjKjwfAZ N8EX9qBfflKVGx3tyWwCBa03WUEcehlW5bwm/x+LoOidbjCI0QxNnvz/3RzbPt4H/nrG RoRCUS1zFxm25KUk3ec/d1MjqMIYIND3FUqufRKJt/yaZkoiL0z1Q5uo+qnLDv/LaVlV HnNw== X-Gm-Message-State: AOAM533kNaXiJewzn8d22OJEEe7JsMUvyRN17EvdNssnKcwNSWSmCg3A rf4kNpiSYK94jUJXq/opvJdesCPQ9zKuGvtzk5yCy2yY2VY= X-Google-Smtp-Source: ABdhPJyocwI3GuqyPpUkgS/rQ4Qzy84sLFeNyMx4i8LcOPtVceSaTc4q5YXRMna7IlNhSHTZkmG+3QPbBt4nNJ3lHFQ= X-Received: by 2002:aca:3684:: with SMTP id d126mr37035902oia.129.1621086768222; Sat, 15 May 2021 06:52:48 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> In-Reply-To: <831rad5t18.fsf@gnu.org> From: Ioannis Kappas Date: Sat, 15 May 2021 14:52:39 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, May 11, 2021 at 1:55 PM Eli Zaretskii wrote: > > In which case, having `package-install-file' load the .el package file > > metaphorically and modifying `package-unpack' to store 'single files > > with 'raw-text should satisfy the requirement? Thus header parsing is > > done in the intended coding system, while the end package is a "copy" > > of the original. > > Sorry, you lost me here: I don't think I understand the details of how > you intend to do the above. Yes, sorry, you are right, I misunderstood how 'raw-text is used in `hexlify-buffer'. I thought it was used to discern the *original bytes seq* from the encoded buffer and send them over to the hexl process for processing. So, I was inquiring whether we could use the same in our case, i.e. decode the .el file (with `insert-file-contents'), but have `package-unpack' save it with 'raw-text instead of 'no-conversion. I was wrong though in my extrapolation, since 'raw-text specifies the encoding to use for reading data from the synchronous hexl process, not allegedly writing the original file byte sequence to the process from the buffer. Thus I take it there is no way to reconstruct the original file sequence from an encoded buffer under all circumstances as you said, even in our specific case where the scope is just an .el file. I shall have a look next whether we could always load the package with `insert-file-contents-literally' but parse headers with the correct encoding (`find-operation-coding-system' looks like a promising fn to determine the correct encoding from a literal file buffer). Thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 16 05:09:24 2021 Received: (at 48137) by debbugs.gnu.org; 16 May 2021 09:09:24 +0000 Received: from localhost ([127.0.0.1]:49712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1liCm3-0002fr-PM for submit@debbugs.gnu.org; Sun, 16 May 2021 05:09:24 -0400 Received: from mail-oi1-f173.google.com ([209.85.167.173]:43696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1liCm2-0002ff-LB for 48137@debbugs.gnu.org; Sun, 16 May 2021 05:09:22 -0400 Received: by mail-oi1-f173.google.com with SMTP id j75so3777843oih.10 for <48137@debbugs.gnu.org>; Sun, 16 May 2021 02:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zfJy1wXpAN+VPz7VBevxpFecUlNND/9FXkpmngbaIRM=; b=GVnNKlokosZkASaBnUGZ6LOzk/CiTcG7gQ6jGqolu5VaCiyNST/BnnfbeyAAGrX0cR VjmN5g0QsPbZTokfLS64D97eil0pIqWoFwdfDd9lfs1Lc6RZVyAh7VVcJIW+LcfS8tIO qewbmvcwl4XSVeZDuzYIg8/HXevMbxCZ5nS+eByO7BVM+o0ci8WyUWjNMCizoUpHYlEi KEzvX5ZBGpMQ0KoGo/5pdgPE5ZlObsggCpnoMPuqmd8ZEJ3FREibDeT55kY4xZGRz19y +3N6AtjsqDkzHxWrf0dSYepO/MXeqD1/bERV86hHjiWiaaNR0V8w4gc+QhhwK30iaXFZ KbOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zfJy1wXpAN+VPz7VBevxpFecUlNND/9FXkpmngbaIRM=; b=JKdD3pLPonctHeccZfMLN7mQ90HFpq4YP4wN/hZ67O8VDqrCca8GUCxZjVCnVmWSTq B+i2b9kpsP4u3pMx6PRyIYtZ6QMHqYJhli77s5jO5LfT2DgpcsxZaTJSALG8Schv7xzl i5mm9yL/Qfv3A/VqScv8pxvNaZa8FvSWNDKrLMo+jf9sRXaLlKlB+G5QSH4kn+xJC/rp Hijmd2QYHf5VMm/IjW2mttT+zsT7sNpJd1CK/M3SBhgrM3sfWVvHV8pcRjAdpUOJQTd1 P6CNECUBuXaA5xKdPYSAB4UpUlCBG1PTe2I9SYrwi2LvHXv/me0idvisMHUJ18eHCFQX SPww== X-Gm-Message-State: AOAM530ZaEk7717Mg7xyJ+zewpygZyPohJdPukcbwE1EDOZ+xmdaf/p5 mRBesND3jufuXEH6wmkg/+9JjETzSOKgvnKfefM= X-Google-Smtp-Source: ABdhPJwMhiZ0TEmjO1NfsHI2EJKRdjzjYorvp0Qu2D88QjoVD+VhognnbVUCSju0blHY3j99+e3d6/L5qB5mO1aRApo= X-Received: by 2002:aca:30cc:: with SMTP id w195mr39501149oiw.78.1621156157085; Sun, 16 May 2021 02:09:17 -0700 (PDT) MIME-Version: 1.0 References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> In-Reply-To: From: Ioannis Kappas Date: Sun, 16 May 2021 10:09:07 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, May 15, 2021 at 2:52 PM Ioannis Kappas wrote: > I shall have a look next whether we could always load the package with > `insert-file-contents-literally' but parse headers with the correct > encoding (`find-operation-coding-system' looks like a promising fn > to determine the correct encoding from a literal file buffer). Please find below a patch to read package headers from a temporarily decoded buffer, while keeping the literal buffer (which will be used to install the package) intact. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ecb2573cab..a7a11bc6cc 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2122,8 +2122,22 @@ package-install-from-buffer ((derived-mode-p 'tar-mode) (package-tar-file-info)) (t - (save-excursion - (package-buffer-info))))) + ;; Package headers should be parsed from decoded text + ;; (see Bug#48137) where possible. + (if (and (eq buffer-file-coding-system 'no-conversion) + buffer-file-name) + (let* ((package-buffer (current-buffer)) + (decoding-system + (car (find-operation-coding-system 'insert-file-contents + (cons buffer-file-name + package-buffer))))) + (with-temp-buffer + (insert-buffer-substring package-buffer) + (decode-coding-region (point-min) (point-max) decoding-system) + (package-buffer-info))) + + (save-excursion + (package-buffer-info)))))) (name (package-desc-name pkg-desc))) ;; Download and install the dependencies. (let* ((requires (package-desc-reqs pkg-desc)) @@ -2148,6 +2162,7 @@ package-install-file (setq default-directory file) (dired-mode)) (insert-file-contents-literally file) + (set-visited-file-name file) (when (string-match "\\.tar\\'" file) (tar-mode))) (package-install-from-buffer))) Notes: - The logic can be moved to `package-buffer-info'. - Ideally, I would have liked to only copy and header section to the temporary buffer for decoding, but the `(while (comment-forward))` trick that I've tried fails to move past the headers section in literal buffers with CRLF pairs. Perhaps it is better after all not to try and use any regex ops on a 'binary buffer? thanks From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 04:20:53 2021 Received: (at 48137) by debbugs.gnu.org; 29 May 2021 08:20:54 +0000 Received: from localhost ([127.0.0.1]:55938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmuDF-0006hI-Mm for submit@debbugs.gnu.org; Sat, 29 May 2021 04:20:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmuDE-0006h5-9j for 48137@debbugs.gnu.org; Sat, 29 May 2021 04:20:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38694) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmuD9-0008N1-4N; Sat, 29 May 2021 04:20:47 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4444 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmuD8-0002Zr-OW; Sat, 29 May 2021 04:20:47 -0400 Date: Sat, 29 May 2021 11:20:55 +0300 Message-Id: <835yz26jdk.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Sun, 16 May 2021 10:09:07 +0100) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <834kfmabvs.fsf@gnu.org> <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Sun, 16 May 2021 10:09:07 +0100 > Cc: Stefan Monnier , 48137@debbugs.gnu.org > > On Sat, May 15, 2021 at 2:52 PM Ioannis Kappas wrote: > > I shall have a look next whether we could always load the package with > > `insert-file-contents-literally' but parse headers with the correct > > encoding (`find-operation-coding-system' looks like a promising fn > > to determine the correct encoding from a literal file buffer). > > Please find below a patch to read package headers from a temporarily > decoded buffer, while keeping the literal buffer (which will be used > to install the package) intact. Stefan, any comments? From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 09:59:12 2021 Received: (at 48137) by debbugs.gnu.org; 29 May 2021 13:59:12 +0000 Received: from localhost ([127.0.0.1]:57462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmzUd-0005Dx-Pd for submit@debbugs.gnu.org; Sat, 29 May 2021 09:59:11 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmzUb-0005Dh-Dx for 48137@debbugs.gnu.org; Sat, 29 May 2021 09:59:11 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BE9A5804FD; Sat, 29 May 2021 09:59:03 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 69B688040B; Sat, 29 May 2021 09:59:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622296742; bh=AUJSWV0PHlmztSG68c/qFcFJ7jjNQbVAkPn/OQYgI2M=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Vzm+B/ubfX2Kab+pfIurUVQA6vyOxEBSdhwwZmvdD8sL4WPFagonr9T0xth01pgKd Q2UQZ9wqlervEjC6+ofDp/EGj9FfUuOywm6KucyvLrYTpVvtGK7R8AG0W7xVBG01Mv vxN1LVvr9bZ6183reaeSmBUDePbFkgc1ukYr4kYAkTShfosdJuwzLp/ZgOFDhe3Pbx AGQxIcdlvmUWJKwDYJyqVdG3BL3wkKiFyNBpGL2a408yU4BTQTs2qnV034o8UvBnxQ PG2EVjdAXKGoBYafUfNU27WgfVfkFW0qRAaNlKLjPIf9aTqs41Ynl/AD9GXvY7I9Rk z67WcmkJMWfgw== Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1BCAE120FAB; Sat, 29 May 2021 09:59:02 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Message-ID: References: <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> <835yz26jdk.fsf@gnu.org> Date: Sat, 29 May 2021 09:59:01 -0400 In-Reply-To: <835yz26jdk.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 May 2021 11:20:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.081 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: Ioannis Kappas , 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> From: Ioannis Kappas >> Date: Sun, 16 May 2021 10:09:07 +0100 >> Cc: Stefan Monnier , 48137@debbugs.gnu.org >> >> On Sat, May 15, 2021 at 2:52 PM Ioannis Kappas wrote: >> > I shall have a look next whether we could always load the package with >> > `insert-file-contents-literally' but parse headers with the correct >> > encoding (`find-operation-coding-system' looks like a promising fn >> > to determine the correct encoding from a literal file buffer). >> >> Please find below a patch to read package headers from a temporarily >> decoded buffer, while keeping the literal buffer (which will be used >> to install the package) intact. > > Stefan, any comments? No particular comment from me, except: this is tricky enough that it would benefit from some regression tests. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 10:09:08 2021 Received: (at 48137) by debbugs.gnu.org; 29 May 2021 14:09:08 +0000 Received: from localhost ([127.0.0.1]:57477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmzeG-0005UG-HQ for submit@debbugs.gnu.org; Sat, 29 May 2021 10:09:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmzeE-0005Tl-3n for 48137@debbugs.gnu.org; Sat, 29 May 2021 10:09:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43990) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmze8-0007e8-Pn; Sat, 29 May 2021 10:09:00 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4173 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmze8-0006oK-Cz; Sat, 29 May 2021 10:09:00 -0400 Date: Sat, 29 May 2021 17:09:10 +0300 Message-Id: <83k0nh6395.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sat, 29 May 2021 09:59:01 -0400) Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> <835yz26jdk.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: ioannis.kappas@gmail.com, 48137@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Ioannis Kappas , 48137@debbugs.gnu.org > Date: Sat, 29 May 2021 09:59:01 -0400 > > >> Please find below a patch to read package headers from a temporarily > >> decoded buffer, while keeping the literal buffer (which will be used > >> to install the package) intact. > > > > Stefan, any comments? > > No particular comment from me, except: this is tricky enough that > it would benefit from some regression tests. Thanks. Yes, that's a good idea. Ioannis, could you perhaps add some tests, both using existing packages and perhaps also some you concoct just for testing purposes? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 06 05:11:26 2021 Received: (at 48137) by debbugs.gnu.org; 6 Jun 2021 09:11:26 +0000 Received: from localhost ([127.0.0.1]:50626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpooY-0005LH-IZ for submit@debbugs.gnu.org; Sun, 06 Jun 2021 05:11:26 -0400 Received: from mail-ot1-f41.google.com ([209.85.210.41]:37815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpooX-0005L4-1s for 48137@debbugs.gnu.org; Sun, 06 Jun 2021 05:11:25 -0400 Received: by mail-ot1-f41.google.com with SMTP id v19-20020a0568301413b0290304f00e3d88so13655170otp.4 for <48137@debbugs.gnu.org>; Sun, 06 Jun 2021 02:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yn8Od6UIjetq5lY92U+E8I1Y/ownPqyXtqjPANSgKJw=; b=O2A/glqNETiX8/g42HqwAvfKOJA9Sz9/pHWzYIL6ZW467TbtYobpRCR0jdSi1ANTIe pEMBvqgySoCJHMcPbN7WoOFtKkq2U2H6fD0/DJ7Gow0TRWmw7F4r2VHNsZsoBn2KVDrw iKbp5e44PEd1XOqgc/UgIrPyXyRvXNyexa4dEgi5DO2Bt9hIV67VeaD/YWPq1LpHsdKe KD4cQ+X37300Ux97QOtW8+Mp9Hj2elYIReFWoaW02jG8mWTc+2X8erSyXBdr59KNMlQI AsGxsAvgUHy/7bGhi8jOjGpikZY99LxsR7OrItiBpkZH2MSUYnzYCuPJU1ndBsDO2GHI ZLBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yn8Od6UIjetq5lY92U+E8I1Y/ownPqyXtqjPANSgKJw=; b=C/5M3LOIhufQC2v5vqc50/MQmpi4YSj5zlkRn8O+vq7FqSdqgUA4NuXs4dm30VKobf aIgYTiidbyfXPgUh7Pg0EUxxWl8a4KQOinSYTJUveqjjo3Lp05a2ZC/k+oWpPeekYxZV HUReOEg3qe4hBGpG7QKuIGWIblFJMJnldrpfoCn1Fc3RUAY8PqqconcGPXyngabiJu/d faNCJT5YiZ1jte0JH5HnNnE+spbbdk1GKBN9YBvmmFu3u7fzrUBl55+KT36UU5vbduyJ Lq6bnc7gOaVJsygaxm1+6oQvJ9LQeFYmQm0nttmSGQxpbbw3xJzcrAcLeda/3mS+KDkV bqsQ== X-Gm-Message-State: AOAM530dwldsJk9B2vcOgQ4iNAfXYE9FVnMXMYGj5kzSYeADALUj3dI9 Q0Icr1yCTESR9dpEJmejtw9b1R7CIdMBMJlfKeU= X-Google-Smtp-Source: ABdhPJxmFvIPPhWIE3+7cfXLB9gWavTyavD3HaC+v3guE0ebOKKxlrRuc9maONSi5DYPBwMgsK11C03Rx66ea7hAx+U= X-Received: by 2002:a05:6830:1f52:: with SMTP id u18mr9535869oth.298.1622970679473; Sun, 06 Jun 2021 02:11:19 -0700 (PDT) MIME-Version: 1.0 References: <83tunj651i.fsf@gnu.org> <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> <835yz26jdk.fsf@gnu.org> <83k0nh6395.fsf@gnu.org> In-Reply-To: <83k0nh6395.fsf@gnu.org> From: Ioannis Kappas Date: Sun, 6 Jun 2021 10:11:10 +0100 Message-ID: Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings To: Eli Zaretskii Content-Type: multipart/mixed; boundary="000000000000d4d4c205c4154e31" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48137 Cc: 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d4d4c205c4154e31 Content-Type: text/plain; charset="UTF-8" On Sat, May 29, 2021 at 3:09 PM Eli Zaretskii wrote: > > > From: Stefan Monnier > > Cc: Ioannis Kappas , 48137@debbugs.gnu.org > > Date: Sat, 29 May 2021 09:59:01 -0400 > > > > >> Please find below a patch to read package headers from a temporarily > > >> decoded buffer, while keeping the literal buffer (which will be used > > >> to install the package) intact. > > > > > > Stefan, any comments? > > > > No particular comment from me, except: this is tricky enough that > > it would benefit from some regression tests. > > Thanks. Yes, that's a good idea. Ioannis, could you perhaps add some > tests, both using existing packages and perhaps also some you concoct > just for testing purposes? Please find attached a patch with the earlier fix and two new ert package tests. `package-test-install-file' tests the installation of single .el file and a .tar archive packages as referenced from the test harness. `package-test-install-file-EOLs' rewrites the single .el package multiple time with different EOL conventions ('unix, 'dos and 'mac), installs them and confirms that they are written verbatim without modifications to the package directory by comparing that the md5 hashes of the installing package vs the installed package are the same. All package tests pass locally both on GNU/Linux and MS-Windows. Please feel free to scrutinize the patch and/or make modifications. Thanks --000000000000d4d4c205c4154e31 Content-Type: application/octet-stream; name="emacs-bug48137.patch" Content-Disposition: attachment; filename="emacs-bug48137.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kpkyqv3p0 ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9wYWNrYWdlLmVsIGIvbGlzcC9lbWFjcy1saXNw L3BhY2thZ2UuZWwKaW5kZXggNWRmOWI1MzY1Ny4uMWI4ZjMzMDRiYSAxMDA2NDQKLS0tIGEvbGlz cC9lbWFjcy1saXNwL3BhY2thZ2UuZWwKKysrIGIvbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UuZWwK QEAgLTIxOTUsOCArMjE5NSwyMiBAQCBwYWNrYWdlLWluc3RhbGwtZnJvbS1idWZmZXIKICAgICAg ICAgICAgICgoZGVyaXZlZC1tb2RlLXAgJ3Rhci1tb2RlKQogICAgICAgICAgICAgIChwYWNrYWdl LXRhci1maWxlLWluZm8pKQogICAgICAgICAgICAgKHQKLSAgICAgICAgICAgICAoc2F2ZS1leGN1 cnNpb24KLSAgICAgICAgICAgICAgKHBhY2thZ2UtYnVmZmVyLWluZm8pKSkpKQorICAgICAgICAg ICAgIDs7IFBhY2thZ2UgaGVhZGVycyBzaG91bGQgYmUgcGFyc2VkIGZyb20gZGVjb2RlZCB0ZXh0 CisgICAgICAgICAgICAgOzsgKHNlZSBCdWcjNDgxMzcpIHdoZXJlIHBvc3NpYmxlLgorICAgICAg ICAgICAgIChpZiAoYW5kIChlcSBidWZmZXItZmlsZS1jb2Rpbmctc3lzdGVtICduby1jb252ZXJz aW9uKQorICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci1maWxlLW5hbWUpCisgICAgICAgICAg ICAgICAgIChsZXQqICgocGFja2FnZS1idWZmZXIgKGN1cnJlbnQtYnVmZmVyKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgIChkZWNvZGluZy1zeXN0ZW0KKyAgICAgICAgICAgICAgICAgICAgICAg ICAoY2FyIChmaW5kLW9wZXJhdGlvbi1jb2Rpbmctc3lzdGVtICdpbnNlcnQtZmlsZS1jb250ZW50 cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKGNvbnMgYnVmZmVyLWZpbGUtbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZS1idWZmZXIpKSkp KQorICAgICAgICAgICAgICAgICAgICh3aXRoLXRlbXAtYnVmZmVyCisgICAgICAgICAgICAgICAg ICAgICAoaW5zZXJ0LWJ1ZmZlci1zdWJzdHJpbmcgcGFja2FnZS1idWZmZXIpCisgICAgICAgICAg ICAgICAgICAgICAoZGVjb2RlLWNvZGluZy1yZWdpb24gKHBvaW50LW1pbikgKHBvaW50LW1heCkg ZGVjb2Rpbmctc3lzdGVtKQorICAgICAgICAgICAgICAgICAgICAgKHBhY2thZ2UtYnVmZmVyLWlu Zm8pKSkKKworICAgICAgICAgICAgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAgICAgICAgICAg IChwYWNrYWdlLWJ1ZmZlci1pbmZvKSkpKSkpCiAgICAgICAgICAobmFtZSAocGFja2FnZS1kZXNj LW5hbWUgcGtnLWRlc2MpKSkKICAgICA7OyBEb3dubG9hZCBhbmQgaW5zdGFsbCB0aGUgZGVwZW5k ZW5jaWVzLgogICAgIChsZXQqICgocmVxdWlyZXMgKHBhY2thZ2UtZGVzYy1yZXFzIHBrZy1kZXNj KSkKQEAgLTIyMjIsNiArMjIzNiw3IEBAIHBhY2thZ2UtaW5zdGFsbC1maWxlCiAgICAgICAgICAg KHNldHEgZGVmYXVsdC1kaXJlY3RvcnkgZmlsZSkKICAgICAgICAgICAoZGlyZWQtbW9kZSkpCiAg ICAgICAoaW5zZXJ0LWZpbGUtY29udGVudHMtbGl0ZXJhbGx5IGZpbGUpCisgICAgICAoc2V0LXZp c2l0ZWQtZmlsZS1uYW1lIGZpbGUpCiAgICAgICAod2hlbiAoc3RyaW5nLW1hdGNoICJcXC50YXJc XCciIGZpbGUpICh0YXItbW9kZSkpKQogICAgIChwYWNrYWdlLWluc3RhbGwtZnJvbS1idWZmZXIp KSkKIApkaWZmIC0tZ2l0IGEvdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFja2FnZS10ZXN0cy5lbCBi L3Rlc3QvbGlzcC9lbWFjcy1saXNwL3BhY2thZ2UtdGVzdHMuZWwKaW5kZXggNjdkNjQ3ZDNiOS4u Mjk0MzU3OTk1NSAxMDA2NDQKLS0tIGEvdGVzdC9saXNwL2VtYWNzLWxpc3AvcGFja2FnZS10ZXN0 cy5lbAorKysgYi90ZXN0L2xpc3AvZW1hY3MtbGlzcC9wYWNrYWdlLXRlc3RzLmVsCkBAIC0yNjMs NiArMjYzLDc0IEBAIHBhY2thZ2UtdGVzdC1pbnN0YWxsLXNpbmdsZQogICAgICAgKHNob3VsZCAo ZmlsZS1leGlzdHMtcCBhdXRvbG9hZHMtZmlsZSkpCiAgICAgICAoc2hvdWxkLW5vdCAoZ2V0LWZp bGUtYnVmZmVyIGF1dG9sb2Fkcy1maWxlKSkpKSkKIAorKGVydC1kZWZ0ZXN0IHBhY2thZ2UtdGVz dC1pbnN0YWxsLWZpbGUgKCkKKyAgIkluc3RhbGwgZmlsZXMgd2l0aCBgcGFja2FnZS1pbnN0YWxs LWZpbGUnLiIKKyAgKHdpdGgtcGFja2FnZS10ZXN0ICg6YmFzZWRpciAoZXJ0LXJlc291cmNlLWRp cmVjdG9yeSkpCisgICAgKHBhY2thZ2UtaW5pdGlhbGl6ZSkKKyAgICAobGV0KiAoKHBrZy1lbCAi c2ltcGxlLXNpbmdsZS0xLjMuZWwiKQorICAgICAgICAgICAoc291cmNlLWZpbGUgKGV4cGFuZC1m aWxlLW5hbWUgcGtnLWVsIChlcnQtcmVzb3VyY2UtZGlyZWN0b3J5KSkpKQorICAgICAgKHNob3Vs ZC1ub3QgKHBhY2thZ2UtaW5zdGFsbGVkLXAgJ3NpbXBsZS1zaW5nbGUpKQorICAgICAgKHBhY2th Z2UtaW5zdGFsbC1maWxlIHNvdXJjZS1maWxlKQorICAgICAgKHNob3VsZCAocGFja2FnZS1pbnN0 YWxsZWQtcCAnc2ltcGxlLXNpbmdsZSkpCisgICAgICAocGFja2FnZS1kZWxldGUgKGNhZHIgKGFz c3EgJ3NpbXBsZS1zaW5nbGUgcGFja2FnZS1hbGlzdCkpKQorICAgICAgKHNob3VsZC1ub3QgKHBh Y2thZ2UtaW5zdGFsbGVkLXAgJ3NpbXBsZS1zaW5nbGUpKSkKKworICAgIChsZXQqICgocGtnLWVs ICJtdWx0aS1maWxlLTAuMi4zLnRhciIpCisgICAgICAgICAgIChzb3VyY2UtZmlsZSAoZXhwYW5k LWZpbGUtbmFtZSBwa2ctZWwgKGVydC1yZXNvdXJjZS1kaXJlY3RvcnkpKSkpCisgICAgICAocGFj a2FnZS1pbml0aWFsaXplKQorICAgICAgKHNob3VsZC1ub3QgKHBhY2thZ2UtaW5zdGFsbGVkLXAg J211bHRpZS1maWxlKSkKKyAgICAgIChwYWNrYWdlLWluc3RhbGwtZmlsZSBzb3VyY2UtZmlsZSkK KyAgICAgIChzaG91bGQgKHBhY2thZ2UtaW5zdGFsbGVkLXAgJ211bHRpLWZpbGUpKQorICAgICAg KHBhY2thZ2UtZGVsZXRlIChjYWRyIChhc3NxICdtdWx0aS1maWxlIHBhY2thZ2UtYWxpc3QpKSkp CisgICAgKSkKKworKGVydC1kZWZ0ZXN0IHBhY2thZ2UtdGVzdC1pbnN0YWxsLWZpbGUtRU9McyAo KQorICAiSW5zdGFsbCBzYW1lIGZpbGUgbXVsdGlwbGUgdGltZSB3aXRoIGBwYWNrYWdlLWluc3Rh bGwtZmlsZScKK2J1dCB3aXRoIGEgZGlmZmVyZW50IGVuZCBvZiBsaW5lIGNvbnZlbnRpb24gKGJ1 ZyM0ODEzNykuIgorICAod2l0aC1wYWNrYWdlLXRlc3QgKDpiYXNlZGlyIChlcnQtcmVzb3VyY2Ut ZGlyZWN0b3J5KSkKKyAgICAocGFja2FnZS1pbml0aWFsaXplKQorICAgIChsZXQqICgocGtnLWVs ICJzaW1wbGUtc2luZ2xlLTEuMy5lbCIpCisgICAgICAgICAgIChzb3VyY2UtZmlsZSAoZXhwYW5k LWZpbGUtbmFtZSBwa2ctZWwgKGVydC1yZXNvdXJjZS1kaXJlY3RvcnkpKSkpCisKKyAgICAgICh3 aXRoLXRlbXAtYnVmZmVyCisgICAgICAgIChpbnNlcnQtZmlsZS1jb250ZW50cyBzb3VyY2UtZmls ZSkKKworICAgICAgICAobGV0IChoYXNoZXMpCisgICAgICAgICAgKGRvbGlzdCAoY29kaW5nICco dW5peCBkb3MgbWFjKSBoYXNoZXMpCisgICAgICAgICAgICAobGV0KiAoKGVvbC1maWxlIChleHBh bmQtZmlsZS1uYW1lIHBrZy1lbCBwYWNrYWdlLXRlc3QtdXNlci1kaXIpKSkKKyAgICAgICAgICAg ICAgOzsgc2F2ZSBwYWNrYWdlIHdpdGggdGhpcyBFT0wgY29udmVudGlvbi4KKyAgICAgICAgICAg ICAgKHNldC1idWZmZXItZmlsZS1jb2Rpbmctc3lzdGVtIGNvZGluZykKKyAgICAgICAgICAgICAg KHdyaXRlLXJlZ2lvbiAocG9pbnQtbWluKSAocG9pbnQtbWF4KSBlb2wtZmlsZSkKKworICAgICAg ICAgICAgICAoc2hvdWxkLW5vdCAocGFja2FnZS1pbnN0YWxsZWQtcCAnc2ltcGxlLXNpbmdsZSkp CisgICAgICAgICAgICAgIChwYWNrYWdlLWluc3RhbGwtZmlsZSBlb2wtZmlsZSkKKyAgICAgICAg ICAgICAgKHNob3VsZCAocGFja2FnZS1pbnN0YWxsZWQtcCAnc2ltcGxlLXNpbmdsZSkpCisKKyAg ICAgICAgICAgICAgOzsgY2hlY2sgdGhlIHBhY2thZ2UgZmlsZSBoYXMgYmVlbiBpbnN0YWxsZWQg dW5tb2RpZmllZC4KKyAgICAgICAgICAgICAgKGxldCAoKGVvbC1oYXNoICh3aXRoLXRlbXAtYnVm ZmVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnNlcnQtZmlsZS1jb250ZW50 cy1saXRlcmFsbHkgZW9sLWZpbGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi dWZmZXItaGFzaCkpKSkKKyAgICAgICAgICAgICAgICA7OyBhbHNvIHBlcmZvcm0gYW4gYWRkaXRp b25hbCBjaGVjayB0aGF0IHRoZSBwYWNrYWdlCisgICAgICAgICAgICAgICAgOzsgZmlsZSBjcmVh dGVkIHdpdGggdGhpcyBFT0wgY29udmVudGlvbiBpcyBkaWZmZXJlbnQKKyAgICAgICAgICAgICAg ICA7OyB0aGFuIGFsbCB0aGUgb3RoZXJzIGNyZWF0ZWQgc28gZmFyLgorICAgICAgICAgICAgICAg IChzaG91bGQtbm90IChtZW1iZXIgZW9sLWhhc2ggaGFzaGVzKSkKKyAgICAgICAgICAgICAgICAo c2V0cSBoYXNoZXMgKGNvbnMgZW9sLWhhc2ggaGFzaGVzKSkKKworICAgICAgICAgICAgICAgIChs ZXQqICgoZGVzY3IgKGNhZHIgKGFzc3EgJ3NpbXBsZS1zaW5nbGUgcGFja2FnZS1hbGlzdCkpKQor ICAgICAgICAgICAgICAgICAgICAgICAocGtnLWRpciAocGFja2FnZS1kZXNjLWRpciBkZXNjcikp CisgICAgICAgICAgICAgICAgICAgICAgIChkZXN0LWZpbGUgKGV4cGFuZC1maWxlLW5hbWUgInNp bXBsZS1zaW5nbGUuZWwiIHBrZy1kaXIgKSkKKyAgICAgICAgICAgICAgICAgICAgICAgKGRlc3Qt aGFzaCAod2l0aC10ZW1wLWJ1ZmZlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKGluc2VydC1maWxlLWNvbnRlbnRzLWxpdGVyYWxseSBkZXN0LWZpbGUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoYnVmZmVyLWhhc2gpKSkpCisKKyAgICAgICAgICAg ICAgICAgIChzaG91bGQgKHN0cmluZz0gZGVzdC1oYXNoIGVvbC1oYXNoKSkpKQorCisgICAgICAg ICAgICAgIChwYWNrYWdlLWRlbGV0ZSAoY2FkciAoYXNzcSAnc2ltcGxlLXNpbmdsZSBwYWNrYWdl LWFsaXN0KSkpCisgICAgICAgICAgICAgIChzaG91bGQtbm90IChwYWNrYWdlLWluc3RhbGxlZC1w ICdzaW1wbGUtc2luZ2xlKSkKKyAgICAgICAgICAgICAgKGRlbGV0ZS1maWxlIGVvbC1maWxlKQor ICAgICAgICAgICAgICAoc2hvdWxkLW5vdCAoZmlsZS1leGlzdHMtcCBlb2wtZmlsZSkpCisgICAg ICAgICAgICAgICkpKSkpKSkKKwogKGVydC1kZWZ0ZXN0IHBhY2thZ2UtdGVzdC1pbnN0YWxsLWRl cGVuZGVuY3kgKCkKICAgIkluc3RhbGwgYSBwYWNrYWdlIHdoaWNoIGluY2x1ZGVzIGEgZGVwZW5k ZW5jeS4iCiAgICh3aXRoLXBhY2thZ2UtdGVzdCAoKQo= --000000000000d4d4c205c4154e31-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 06 05:24:07 2021 Received: (at control) by debbugs.gnu.org; 6 Jun 2021 09:24:08 +0000 Received: from localhost ([127.0.0.1]:50667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpp0p-0005gS-Pr for submit@debbugs.gnu.org; Sun, 06 Jun 2021 05:24:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpp0o-0005fz-1o for control@debbugs.gnu.org; Sun, 06 Jun 2021 05:24:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hSLi9jfZpVVSPxCd/MGzdSoY4gyhAmTRUoF5pJ2X8xI=; b=D6Uhc3kJSSXy8OvW49VPpDZZux EPvwCuhC1dPJsiDlhmVRMGhbelfvAhPAexUuZ317yOgXVHsKILHe9Sw/V6RZHcQ3BMItt2F6lXAGj McE6BY8gMF49Wn55XWv+nZWP9KGWa/8kAr4PfTi2OdeuQFItjDzSxI2bQNB16+EwdpiE=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lpp0g-0004s5-Cj for control@debbugs.gnu.org; Sun, 06 Jun 2021 11:24:00 +0200 Date: Sun, 06 Jun 2021 11:23:57 +0200 Message-Id: <878s3nuz0y.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #48137 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 48137 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 48137 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 09:54:44 2021 Received: (at 48137) by debbugs.gnu.org; 20 Jul 2021 13:54:44 +0000 Received: from localhost ([127.0.0.1]:33252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qCq-0007xx-DP for submit@debbugs.gnu.org; Tue, 20 Jul 2021 09:54:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qCo-0007xg-77 for 48137@debbugs.gnu.org; Tue, 20 Jul 2021 09:54:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=usjVBUaqSJBlHm2SLigCDgDMxtCCbLCWaENNnutp0Jw=; b=GyVLBnzYQYt6CuUd/Kz4Eks0Ft n2v59ZmgQtuTDd6zMwFajJjPy3+X//i1tif6jJsUEttlSRLDBKTTOGneyComaO1yf8EioD6BMogIo sCosAmVyz3/V2PbWfkYi4QqQRUPUYU8dzXu6CivQnPOnhdzad6gA629bB69TDPTVT8BI=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5qCe-0003sh-2j; Tue, 20 Jul 2021 15:54:34 +0200 From: Lars Ingebrigtsen To: Ioannis Kappas Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings References: <83lf8u68bu.fsf@gnu.org> <83mtta4gtf.fsf@gnu.org> <83fsz24f2x.fsf@gnu.org> <83v97x2xum.fsf@gnu.org> <83bl9nevd3.fsf@gnu.org> <831rad5t18.fsf@gnu.org> <835yz26jdk.fsf@gnu.org> <83k0nh6395.fsf@gnu.org> X-Now-Playing: Unbalance's _Fabric 94: Steffi_: "Freedom" Date: Tue, 20 Jul 2021 15:54:31 +0200 In-Reply-To: (Ioannis Kappas's message of "Sun, 6 Jun 2021 10:11:10 +0100") Message-ID: <87bl6xdrag.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Ioannis Kappas writes: >> Thanks. Yes, that's a good idea. Ioannis, could you perhaps add some >> tests, both using existing packages and perhaps also some you concoct >> just for testing purposes? > > Please find attached [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48137 Cc: Eli Zaretskii , 48137@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ioannis Kappas writes: >> Thanks. Yes, that's a good idea. Ioannis, could you perhaps add some >> tests, both using existing packages and perhaps also some you concoct >> just for testing purposes? > > Please find attached a patch with the earlier fix and two new ert > package tests. Skimming this thread, it seemed people agreed that this was the right solution, so I've now installed the patch in Emacs 28. This change was just small enough to apply without assigning copyright to the FSF, but for future patches you want to submit, it might make sense to get the paperwork started now, so that subsequent patches can be applied speedily. Would you be willing to sign such paperwork? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 09:54:51 2021 Received: (at control) by debbugs.gnu.org; 20 Jul 2021 13:54:51 +0000 Received: from localhost ([127.0.0.1]:33255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qCx-0007yK-LV for submit@debbugs.gnu.org; Tue, 20 Jul 2021 09:54:51 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qCw-0007y5-7g for control@debbugs.gnu.org; Tue, 20 Jul 2021 09:54:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cLeSct6HeYcRdBJgCNjsE2ZVV7Ap3IdoCikCKpBperc=; b=fsy1Wp/RoEsUUXa9t6IBH2DGc2 La81kXGICcCgx2Gg/D0SGe5G6ab9hWOUJMicIp3aNGM6wgLHaSyvpXd6yuyh+JQ3s/U5uMg0WfRCP 0J+fZfyNjCN33SbHllqCeF49AA2G3PKiNF5+lVXWz7BmR54sF+bl4sfUwdr6c9LkWj6w=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5qCo-0003sx-GY for control@debbugs.gnu.org; Tue, 20 Jul 2021 15:54:44 +0200 Date: Tue, 20 Jul 2021 15:54:42 +0200 Message-Id: <87a6mhdra5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #48137 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 48137 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 48137 28.1 quit From unknown Sun Aug 17 22:00:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 18 Aug 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator