From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Hopkins Newsgroups: gmane.emacs.bugs Subject: bug#58367: `package-install-file' rejects some .tar files (tentative patch) Date: Sat, 08 Oct 2022 23:45:11 +0100 Message-ID: <4315b955f7be21612324290ea97dcdc0@unbit.co.uk> References: <263dae3ce307236c2694a2bc0baa3f63@unbit.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25078"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.5.2 Cc: 58367@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 09 00:46:49 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohIan-0006JY-Ab for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Oct 2022 00:46:49 +0200 Original-Received: from localhost ([::1]:39238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohIal-0000wm-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 18:46:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohIa2-0000w9-Lj for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 18:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohIa2-0006gm-Am for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 18:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohIa2-00054Q-12 for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 18:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Hopkins Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2022 22:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58367-submit@debbugs.gnu.org id=B58367.166526911919434 (code B ref 58367); Sat, 08 Oct 2022 22:46:01 +0000 Original-Received: (at 58367) by debbugs.gnu.org; 8 Oct 2022 22:45:19 +0000 Original-Received: from localhost ([127.0.0.1]:41597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohIZL-00053O-75 for submit@debbugs.gnu.org; Sat, 08 Oct 2022 18:45:19 -0400 Original-Received: from hamster.birch.relay.mailchannels.net ([23.83.209.80]:30457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohIZI-00053G-9Q for 58367@debbugs.gnu.org; Sat, 08 Oct 2022 18:45:17 -0400 X-Sender-Id: 9wt3zsp42r|x-authuser|emacs@unbit.co.uk Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E44AD201486; Sat, 8 Oct 2022 22:45:14 +0000 (UTC) Original-Received: from apollo.krystal.co.uk (unknown [127.0.0.6]) (Authenticated sender: 9wt3zsp42r) by relay.mailchannels.net (Postfix) with ESMTPA id CACBD201244; Sat, 8 Oct 2022 22:45:13 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1665269114; a=rsa-sha256; cv=none; b=VkQJtUCwCscp5uaAMoyX+4Og3J9URfKPRt3JZPcd5AdEjA5fVrEVjvq/yvLO6ery8hhtGx fxPjnJY6YhhNIT3MQSVPKzefPprVBS96ZLCilhL8F8vRGTMKPaEh5ajJYN4puZ4ShC7aIx X/2wHT+KYQBaW10vt0skrFBc/9MMt90cX6hh0eH4aIYlzYQDCSLUdYAq2qiNRfnAcaixrk /Z5AbI+N754vguq2wVf4A4FwIRZeyLZ6wGnUsYIeZYOjClLg+W2AHeX9ckKkF9Aa7WEHn9 fLU48RE8joscWniZT29PGUOvvQEzvjdbWiMBWOl8CDoB96NXwEp7sP5iBcAIFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1665269114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SbspGENm+oQubGHaWoDWLwU+dm3dzFDaZkmKvBhDkpg=; b=LKP/Q0ZIUlku7ZCNIy5zpt9Ck1vVa8M0OzaQp2j4llWZi2xNdrAuQdSmT77ZBQqZnxMpXK 6uya2+irK5eB96hzLusc6bVPtfbgxH/YGNswDc6qgZKd5sWqsbDCTq1T/fYoQBx2E2Ijw3 09lJ+MNpJDdFTqe055bfWOwlpnPriUrd/NjHZ0CJ9zS27/tyc91TpsYb0ZeoVJLN+6fhuD RuwMwOZddwGsicJnyHt/KDMkPP4hdT4wXGKeeCzG++ZKEAYc7yJkADjTMT1TkPadQDsNiY MUkKMG80o6mYm9SthZw4SvKyF9z3mBM1HumC9mTFrz5XgGcgvaiElBwm7m/O7A== ARC-Authentication-Results: i=1; rspamd-7c485dd8cf-k9ns7; auth=pass smtp.auth=9wt3zsp42r smtp.mailfrom=emacs@unbit.co.uk X-Sender-Id: 9wt3zsp42r|x-authuser|emacs@unbit.co.uk X-MC-Relay: Neutral X-MailChannels-SenderId: 9wt3zsp42r|x-authuser|emacs@unbit.co.uk X-MailChannels-Auth-Id: 9wt3zsp42r X-Little-Left: 576dd876780e9e09_1665269114479_4132623288 X-MC-Loop-Signature: 1665269114479:2981749027 X-MC-Ingress-Time: 1665269114478 Original-Received: from apollo.krystal.co.uk (apollo.krystal.co.uk [77.72.0.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.119.144.148 (trex/6.7.1); Sat, 08 Oct 2022 22:45:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unbit.co.uk ; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To: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=SbspGENm+oQubGHaWoDWLwU+dm3dzFDaZkmKvBhDkpg=; b=qmfh/9VeA9hHb+772zv0DYJ+LT HZzcvbxLusVIoyt+5JFTGhWxUb/Bo2Lq6rpOtQH/71E3IUGSnTfXfwKNt+22mW5asiWTLbq4sSY93 hRIBiI9GlZLKi+2swnGcRqUP8SSJKYy6F2P3SREbs/bqTM9OUeXNgQBTpoWuahGtvNxzU2d0K1lSf OdGxeOCiZDJlp19gbqGAzQP0WQyHDOMsImat8WuipqjDuXmRs7NvLWLdkLTRob/C4uKL/LMGrpODF /7jFq0FLrBm4s9Cm0WK8sceANKLWmhEAQtaUgFucYOD/JsaTrcTYIcJXYNdeoK9vIloi2P+HzVlFq eOdSubeg==; Original-Received: from [::1] (port=52642 helo=apollo.krystal.co.uk) by apollo.krystal.co.uk with esmtpa (Exim 4.95) (envelope-from ) id 1ohIZG-002Qbj-5p; Sat, 08 Oct 2022 23:45:11 +0100 In-Reply-To: X-Sender: emacs@unbit.co.uk X-AuthUser: emacs@unbit.co.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244940 Archived-At: On 2022-10-08 17:25, Stefan Monnier wrote: > Thanks for the tarballs for the tests, they were very helpful. > The patch also pointed in the right direction. > > I installed the patch below (plus regression tests) into `master`. Great, thanks for taking a look at this and also fixing the top level lookup for v7-withsub-0.1.tar. I've pulled the latest changes and all the original tar files now install. I've managed to get the ustar-withsub-0.1 to install from a directory and include the sub directories by using `copy-directory' instead of only copying the .el files in the top level. As more inspiration... diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d619142d64..4144a12718 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -947,14 +947,10 @@ package-unpack (pkg-dir (expand-file-name dirname package-user-dir))) (pcase (package-desc-kind pkg-desc) ('dir - (make-directory pkg-dir t) (let ((file-list - (directory-files - default-directory 'full "\\`[^.].*\\.el\\'" 'nosort))) - (dolist (source-file file-list) - (let ((target-el-file - (expand-file-name (file-name-nondirectory source-file) pkg-dir))) - (copy-file source-file target-el-file t))) + (directory-files-recursively + default-directory "." t))) + (copy-directory default-directory pkg-dir nil t 'copy-contents) ;; Now that the files have been installed, this package is ;; indistinguishable from a `tar' or a `single'. Let's make ;; things simple by ensuring we're one of them.