From unknown Tue Jun 17 01:27:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66532: 29.1; dired-guess-default command for tar.zst file fails Resent-From: Michael Eliachevitch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Oct 2023 17:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 66532@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169721666226754 (code B ref -1); Fri, 13 Oct 2023 17:05:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Oct 2023 17:04:22 +0000 Received: from localhost ([127.0.0.1]:47338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrLaG-0006xQ-IA for submit@debbugs.gnu.org; Fri, 13 Oct 2023 13:04:21 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrLaA-0006x5-HY for submit@debbugs.gnu.org; Fri, 13 Oct 2023 13:04:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrLZg-0008WO-Re for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2023 13:03:44 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrLZe-0003nU-KG for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2023 13:03:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A89F9240027 for ; Fri, 13 Oct 2023 19:03:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1697216619; bh=35yPco13isLyPVMIfmklULF1IKS26EiajhnfKKPEEKc=; h=From:To:Subject:Date:Message-ID:MIME-Version:From; b=qgdnwJ/QJFQs7HXJ5Mfa+R2z4C/wUEwP4/hn2Gk4F2dZT9u572IIxOHG1tFKFNpLI tqUiS1BMGTH+jCOGZ47qGJ5OpSMzpk/Cki9Uj/hMD2mpLSzGtQoJCAF0HakamdO5aD MuVMfHZZxwmaG4lAe8YtwA9SExz1vg/u376l2JcKVzTZ10ago7n4Ql28FCa5cQVnzS O6+t4/fEu9/J9kzhrzl7Eaiz/4DlMbDXUJv3E7Adof3kPzwl1b0gT7J5iwyTwmtHAI hL4wY07xeor45GuAaL+6002BSW/vYhaMbum8H8J7cj49LFjjO4qkVJM6lqpePW9gc/ UaweBHSkhvhUw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S6Xs71fhPz9rxQ; Fri, 13 Oct 2023 19:03:39 +0200 (CEST) From: Michael Eliachevitch Date: Fri, 13 Oct 2023 11:54:00 +0000 Message-ID: <87bkd2315h.fsf@posteo.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=185.67.36.65; envelope-from=m.eliachevitch@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: I tried to extract the attached zstandard-compressed tar archive `testdir.tar.zst' using the dired-guess-default suggested shell command, which is unzstd -c %i | tar -xf - It fails with the message Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 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 (+) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed I tried to extract the attached zstandard-compressed tar archive `testdir.tar.zst' using the dired-guess-default suggested shell command, which is unzstd -c %i | tar -xf - It fails with the message zstd: can't stat %i : No such file or directory -- ignored tar: This does not look like a tar archive tar: testdir.tar.zst: Not found in archive What instead works is using the command tar --use-compress-program=unzstd -xvf My GNU tar version also is able to automatically detect zstandard files, so basically just "tar -xvf" is suffisient, but the version with "--use-compress-program=unzstd" is backwards-compatible to older tar versions. I suggest fixing that in `dired-guess-shell-alist-default'. Though there might be tar versions out there which don't support `--use-compress-program' (I don't know), then maybe a piping solution might be better, but that should be done in a way that avoid the above error (not sure what actually causes it). I use GNU tar version 1.35 and unzstd version v1.5.5. --- In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) System Description: Arch Linux Configured using: 'configure --with-pgtk --with-native-compilation=aot --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --with-tree-sitter --localstatedir=/var --with-cairo --disable-build-details --with-harfbuzz --with-libsystemd --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto' 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LC_COLLATE: C.UTF-8 value of $LC_CTYPE: en_GB.UTF-8 value of $LC_MESSAGES: en_US.UTF-8 value of $LC_MONETARY: de_DE.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: de_DE.UTF-8 value of $LANG: C value of $XMODIFIERS: \@im=fcitx locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils shell pcomplete comint ansi-osc ansi-color ring dired-aux cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib dired dired-loaddefs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 88176 12534) (symbols 48 7814 1) (strings 32 22832 2092) (string-bytes 1 699474) (vectors 16 17190) (vector-slots 8 350551 18772) (floats 8 30 40) (intervals 56 440 0) (buffers 984 15)) --=-=-= Content-Type: application/zstd Content-Disposition: attachment; filename=testdir.tar.zst Content-Transfer-Encoding: base64 KLUv/QRYPQMAEoUQFbAlbdIVArZsJfuS4hCJ7N6yJAuVAidfHhGHEkawR9eElgHAEExUlD0FJ/ns rO4zHGZWieUnqf/OJP/voTCBPboBDAD9A/AADKgGYI4CkwcIImiAgqFwAIArAKnBC6xwFScgBwA7 +Hk= --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFNBAEBCAA3FiEEVGkIx4I4OtDn2JTsG4+VyBJdzjEFAmUpeGoZHG0uZWxpYWNo ZXZpdGNoQHBvc3Rlby5kZQAKCRAbj5XIEl3OMZMsB/9uad2HLH/tIVtWVDS1Gyr8 7YV5lTXErTIyQfJ5EDTr7wIMWHt++e3ufuJld6MlpYY9mA/ez4kKsyVvGbZUm1bS +raJg/REvdrY6AejTTwnI8q9CL0aeXNq4MkxDKHgS9pa3i90GjVT5HmVuvaqJWbd dFjN6dt5IbVcvEd2VCIXysnm5Cdp64bW7m1S5az5kjCV9Nm5m/oYkEKf0fZBhGpL KDQkOOoNIqfD++JhelKpXwxAOMAOzEW2en59qIBool++WEylIhHF4oWyRuNBaQsn 4iEgz9minB+5kTP2m1t4vMSEaxiSCRJQ4SeES+sHTMwrK71/f3DPEA0D0eNSGlVM =hWtx -----END PGP SIGNATURE----- --==-=-=-- From unknown Tue Jun 17 01:27:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66532: 29.1; dired-guess-default command for tar.zst file fails Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 06:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Eliachevitch Cc: 66532@debbugs.gnu.org Received: via spool by 66532-submit@debbugs.gnu.org id=B66532.169726471311193 (code B ref 66532); Sat, 14 Oct 2023 06:26:02 +0000 Received: (at 66532) by debbugs.gnu.org; 14 Oct 2023 06:25:13 +0000 Received: from localhost ([127.0.0.1]:47693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrY5J-0002uT-CG for submit@debbugs.gnu.org; Sat, 14 Oct 2023 02:25:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrY5G-0002uG-Tg for 66532@debbugs.gnu.org; Sat, 14 Oct 2023 02:25:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrY4n-00077e-T2; Sat, 14 Oct 2023 02:24:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=HdM805h2CZusJehWv5KdrzAusStKPPECmNQ6qFyhf70=; b=nLph6m7Um+nn 8kv59PncOwtfR1IVaEAaqMgmmEu3xMvuBycJA3/zFcrK6LYgmMJ2AMMHK+6Y+bNNLpL+YR4sAntA3 1IiqYkDYJd+vniycA4/b0WicADjLfJalx574lqzJtOWJShXnnwCo9UOxEimucne69eYKfB2SDRZZ1 N/7Qigl4hmp83ElfhGV81PCZMG33pA65AFYED+X5qmD+3y/6fTOuZ1O4kB16oaA9u5fV9tOOsHV3x d6w3x1jIXzid+ShsbPze3Fddf27bkl9uBkTjPRifaw/UFLg2BkmK58QzlDXt70Vld7vh0zmO48RQl beAGL6+tFhFW1DnFr+kNTQ==; Date: Sat, 14 Oct 2023 09:24:40 +0300 Message-Id: <83zg0lsouv.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87bkd2315h.fsf@posteo.de> (message from Michael Eliachevitch on Fri, 13 Oct 2023 11:54:00 +0000) References: <87bkd2315h.fsf@posteo.de> X-Spam-Score: -2.3 (--) 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: Michael Eliachevitch > Date: Fri, 13 Oct 2023 11:54:00 +0000 > > I tried to extract the attached zstandard-compressed tar archive > `testdir.tar.zst' using the dired-guess-default suggested shell command, > which is > > unzstd -c %i | tar -xf - > > It fails with the message > > zstd: can't stat %i : No such file or directory -- ignored > tar: This does not look like a tar archive > tar: testdir.tar.zst: Not found in archive Does the patch below fix this? diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index fc3f6f4..458acad 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1172,7 +1172,7 @@ dired-guess-shell-alist-default "unxz") ;; zstandard archives - `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -") + `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c * | tar -xf -") `(,(rx ".zst" eos) "unzstd --rm") '("\\.shar\\.Z\\'" "zcat * | unshar") From unknown Tue Jun 17 01:27:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66532: 29.1; dired-guess-default command for tar.zst file fails Resent-From: Michael Eliachevitch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 19:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 66532@debbugs.gnu.org Received: via spool by 66532-submit@debbugs.gnu.org id=B66532.169731124627477 (code B ref 66532); Sat, 14 Oct 2023 19:21:01 +0000 Received: (at 66532) by debbugs.gnu.org; 14 Oct 2023 19:20:46 +0000 Received: from localhost ([127.0.0.1]:50545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrkBp-000797-MI for submit@debbugs.gnu.org; Sat, 14 Oct 2023 15:20:45 -0400 Received: from mout01.posteo.de ([185.67.36.65]:38223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrkBl-00078p-4N for 66532@debbugs.gnu.org; Sat, 14 Oct 2023 15:20:45 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A05FC240027 for <66532@debbugs.gnu.org>; Sat, 14 Oct 2023 21:20:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1697311211; bh=cjBmK4Zc5rN7RD2PJ4oFRXxVZsQDL9hD1vli8xku3C0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=BxgjowVMTuUS9DF3ZJbxK7Y0iplJD0s4unIsMC8bXLTTLwj7bLKINQK2/erIhrHwx diV+i1QMmPcFy1ZJQMTsKL4/XYoIiD1SamALKIbA/mAIvZaO+1v5aOdjssy6mCjLID yr5nFU4DYxrlkYe5JRq1ZWXzC3pqcR+POgPjL9QicdLdj6f+iFSBuzERo9yh+8akDu WVRRNB82QPrcRrgH0BOaSiy2qzj6ERuwucqAzLao61B00sEKUX0J7d+O4/5xBdyXDv nyDbbsNbeWomyo81wuT725f7YDEqnuVQiJ8ANXLFtU+p0/xqLp0d2XGVuie8UH10yh Cm7Lr0XkT52Vg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S7CrC23hgz6tsj; Sat, 14 Oct 2023 21:20:10 +0200 (CEST) References: <87bkd2315h.fsf@posteo.de> <83zg0lsouv.fsf@gnu.org> From: Michael Eliachevitch Date: Sat, 14 Oct 2023 18:41:52 +0000 In-reply-to: <83zg0lsouv.fsf@gnu.org> Message-ID: <877cnp57v9.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: -2.3 (--) 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 (---) > Does the patch below fix this? > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > index fc3f6f4..458acad 100644 > --- a/lisp/dired-aux.el > +++ b/lisp/dired-aux.el > @@ -1172,7 +1172,7 @@ dired-guess-shell-alist-default > "unxz") > > ;; zstandard archives > - `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -") > + `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c * | tar -xf -") > `(,(rx ".zst" eos) "unzstd --rm") > > '("\\.shar\\.Z\\'" "zcat * | unshar") Yes, this patch works for me for a single tar.zst archive. However, when I mark multiple tar.zst archives and then run the suggested shell command (with *) on all of them, only the first archive gets extracted.. I just opened the Emacs manual dired section and found the `?' is a placeholder for which the command gets executed separately for each marked file. So with unzstd -c ? | tar -xf - each marked archive gets successfully extracted. Here also formatted as a patch; diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 2ff620065a5..e0bcae6b005 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1176,7 +1176,7 @@ dired-guess-shell-alist-default "unxz") ;; zstandard archives - `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -") + `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c ? | tar -xf -") `(,(rx ".zst" eos) "unzstd --rm") '("\\.shar\\.Z\\'" "zcat * | unshar") I am just wondering that I didn't find the questionmark placeholder in any of the other suggested commands for compressed tar files, not sure if they work fur multiple marked files, I didn't test that. From unknown Tue Jun 17 01:27:26 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Michael Eliachevitch Subject: bug#66532: closed (Re: bug#66532: 29.1; dired-guess-default command for tar.zst file fails) Message-ID: References: <831qdikesi.fsf@gnu.org> <87bkd2315h.fsf@posteo.de> X-Gnu-PR-Message: they-closed 66532 X-Gnu-PR-Package: emacs Reply-To: 66532@debbugs.gnu.org Date: Wed, 25 Oct 2023 13:35:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1698240902-9167-1" This is a multi-part message in MIME format... ------------=_1698240902-9167-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #66532: 29.1; dired-guess-default command for tar.zst file fails which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 66532@debbugs.gnu.org. --=20 66532: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D66532 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1698240902-9167-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 66532-done) by debbugs.gnu.org; 25 Oct 2023 13:34:22 +0000 Received: from localhost ([127.0.0.1]:57746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qve1d-0002Mi-QT for submit@debbugs.gnu.org; Wed, 25 Oct 2023 09:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qve1a-0002MU-NK for 66532-done@debbugs.gnu.org; Wed, 25 Oct 2023 09:34:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qve0z-0008Ob-W1; Wed, 25 Oct 2023 09:33:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hkt4nPFDfLp3gNHWnrFGnxiZGwafpLXGlXGX+BgkY5I=; b=Ao2s0K4oUgi4 SAFhma61knTuUW6xtUW6t5KLV5F9JgMMt8n+MwgXH0MrdfqeS9pwqpuaE9L/WlxObceHj8hOAqjGR Wqk2iHd62eyBFS+HZWnl3dj/AsTF3ynUEBslqsJE/savCENUbx4ErAxVBRa9Mf9HPit84vJEFADCc PA6poseDdONmlsoZ66ELU/THaqGqBn8E+5JmOn991vDSfOAFV2zicL8GtcPvQMONOKlfhO3dL1o2w GIjvRyeIsTBO3lJGh+JJGr2Imhe0FJHuGkFzx/9xkUGkr6RMmoSa4gxAX00BBiN/xULaKBWiJmmdZ uaw2QUVPriwzWK8L2JYxsw==; Date: Wed, 25 Oct 2023 16:33:17 +0300 Message-Id: <831qdikesi.fsf@gnu.org> From: Eli Zaretskii To: Michael Eliachevitch In-Reply-To: <877cnp57v9.fsf@posteo.de> (message from Michael Eliachevitch on Sat, 14 Oct 2023 18:41:52 +0000) Subject: Re: bug#66532: 29.1; dired-guess-default command for tar.zst file fails References: <87bkd2315h.fsf@posteo.de> <83zg0lsouv.fsf@gnu.org> <877cnp57v9.fsf@posteo.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66532-done Cc: 66532-done@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: Michael Eliachevitch > Cc: 66532@debbugs.gnu.org > Date: Sat, 14 Oct 2023 18:41:52 +0000 > > > > > Does the patch below fix this? > > > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > > index fc3f6f4..458acad 100644 > > --- a/lisp/dired-aux.el > > +++ b/lisp/dired-aux.el > > @@ -1172,7 +1172,7 @@ dired-guess-shell-alist-default > > "unxz") > > > > ;; zstandard archives > > - `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -") > > + `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c * | tar -xf -") > > `(,(rx ".zst" eos) "unzstd --rm") > > > > '("\\.shar\\.Z\\'" "zcat * | unshar") > > > Yes, this patch works for me for a single tar.zst archive. > > However, when I mark multiple tar.zst archives and then run the > suggested shell command (with *) on all of them, only the first archive > gets extracted.. I just opened the Emacs manual dired section and found > the `?' is a placeholder for which the command gets executed separately > for each marked file. So with > > unzstd -c ? | tar -xf - > > each marked archive gets successfully extracted. Here also formatted as a patch; > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > index 2ff620065a5..e0bcae6b005 100644 > --- a/lisp/dired-aux.el > +++ b/lisp/dired-aux.el > @@ -1176,7 +1176,7 @@ dired-guess-shell-alist-default > "unxz") > > ;; zstandard archives > - `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -") > + `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c ? | tar -xf -") > `(,(rx ".zst" eos) "unzstd --rm") > > '("\\.shar\\.Z\\'" "zcat * | unshar") > > I am just wondering that I didn't find the questionmark placeholder in > any of the other suggested commands for compressed tar files, not sure > if they work fur multiple marked files, I didn't test that. Thanks, I installed your variant on the emacs-29 branch, and I'm therefore closing this bug. ------------=_1698240902-9167-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Oct 2023 17:04:22 +0000 Received: from localhost ([127.0.0.1]:47338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrLaG-0006xQ-IA for submit@debbugs.gnu.org; Fri, 13 Oct 2023 13:04:21 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrLaA-0006x5-HY for submit@debbugs.gnu.org; Fri, 13 Oct 2023 13:04:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrLZg-0008WO-Re for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2023 13:03:44 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrLZe-0003nU-KG for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2023 13:03:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A89F9240027 for ; Fri, 13 Oct 2023 19:03:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1697216619; bh=35yPco13isLyPVMIfmklULF1IKS26EiajhnfKKPEEKc=; h=From:To:Subject:Date:Message-ID:MIME-Version:From; b=qgdnwJ/QJFQs7HXJ5Mfa+R2z4C/wUEwP4/hn2Gk4F2dZT9u572IIxOHG1tFKFNpLI tqUiS1BMGTH+jCOGZ47qGJ5OpSMzpk/Cki9Uj/hMD2mpLSzGtQoJCAF0HakamdO5aD MuVMfHZZxwmaG4lAe8YtwA9SExz1vg/u376l2JcKVzTZ10ago7n4Ql28FCa5cQVnzS O6+t4/fEu9/J9kzhrzl7Eaiz/4DlMbDXUJv3E7Adof3kPzwl1b0gT7J5iwyTwmtHAI hL4wY07xeor45GuAaL+6002BSW/vYhaMbum8H8J7cj49LFjjO4qkVJM6lqpePW9gc/ UaweBHSkhvhUw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S6Xs71fhPz9rxQ; Fri, 13 Oct 2023 19:03:39 +0200 (CEST) From: Michael Eliachevitch To: bug-gnu-emacs@gnu.org Subject: 29.1; dired-guess-default command for tar.zst file fails Date: Fri, 13 Oct 2023 11:54:00 +0000 Message-ID: <87bkd2315h.fsf@posteo.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=185.67.36.65; envelope-from=m.eliachevitch@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: I tried to extract the attached zstandard-compressed tar archive `testdir.tar.zst' using the dired-guess-default suggested shell command, which is unzstd -c %i | tar -xf - It fails with the message Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 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: 1.0 (+) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed I tried to extract the attached zstandard-compressed tar archive `testdir.tar.zst' using the dired-guess-default suggested shell command, which is unzstd -c %i | tar -xf - It fails with the message zstd: can't stat %i : No such file or directory -- ignored tar: This does not look like a tar archive tar: testdir.tar.zst: Not found in archive What instead works is using the command tar --use-compress-program=unzstd -xvf My GNU tar version also is able to automatically detect zstandard files, so basically just "tar -xvf" is suffisient, but the version with "--use-compress-program=unzstd" is backwards-compatible to older tar versions. I suggest fixing that in `dired-guess-shell-alist-default'. Though there might be tar versions out there which don't support `--use-compress-program' (I don't know), then maybe a piping solution might be better, but that should be done in a way that avoid the above error (not sure what actually causes it). I use GNU tar version 1.35 and unzstd version v1.5.5. --- In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) System Description: Arch Linux Configured using: 'configure --with-pgtk --with-native-compilation=aot --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --with-tree-sitter --localstatedir=/var --with-cairo --disable-build-details --with-harfbuzz --with-libsystemd --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto' 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LC_COLLATE: C.UTF-8 value of $LC_CTYPE: en_GB.UTF-8 value of $LC_MESSAGES: en_US.UTF-8 value of $LC_MONETARY: de_DE.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: de_DE.UTF-8 value of $LANG: C value of $XMODIFIERS: \@im=fcitx locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils shell pcomplete comint ansi-osc ansi-color ring dired-aux cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib dired dired-loaddefs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 88176 12534) (symbols 48 7814 1) (strings 32 22832 2092) (string-bytes 1 699474) (vectors 16 17190) (vector-slots 8 350551 18772) (floats 8 30 40) (intervals 56 440 0) (buffers 984 15)) --=-=-= Content-Type: application/zstd Content-Disposition: attachment; filename=testdir.tar.zst Content-Transfer-Encoding: base64 KLUv/QRYPQMAEoUQFbAlbdIVArZsJfuS4hCJ7N6yJAuVAidfHhGHEkawR9eElgHAEExUlD0FJ/ns rO4zHGZWieUnqf/OJP/voTCBPboBDAD9A/AADKgGYI4CkwcIImiAgqFwAIArAKnBC6xwFScgBwA7 +Hk= --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFNBAEBCAA3FiEEVGkIx4I4OtDn2JTsG4+VyBJdzjEFAmUpeGoZHG0uZWxpYWNo ZXZpdGNoQHBvc3Rlby5kZQAKCRAbj5XIEl3OMZMsB/9uad2HLH/tIVtWVDS1Gyr8 7YV5lTXErTIyQfJ5EDTr7wIMWHt++e3ufuJld6MlpYY9mA/ez4kKsyVvGbZUm1bS +raJg/REvdrY6AejTTwnI8q9CL0aeXNq4MkxDKHgS9pa3i90GjVT5HmVuvaqJWbd dFjN6dt5IbVcvEd2VCIXysnm5Cdp64bW7m1S5az5kjCV9Nm5m/oYkEKf0fZBhGpL KDQkOOoNIqfD++JhelKpXwxAOMAOzEW2en59qIBool++WEylIhHF4oWyRuNBaQsn 4iEgz9minB+5kTP2m1t4vMSEaxiSCRJQ4SeES+sHTMwrK71/f3DPEA0D0eNSGlVM =hWtx -----END PGP SIGNATURE----- --==-=-=-- ------------=_1698240902-9167-1--