bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29235: Builtin bsdtar decompression for .tar.xz not used


From: Lars Ingebrigtsen
Subject: bug#29235: Builtin bsdtar decompression for .tar.xz not used
Date: Fri, 03 Sep 2021 09:10:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Devon Sean McCullough <Emacs-Hacker2017@jovi.net> writes:

>>> Note that MacOSX lacks xz
>> 
>> Not even under a different name?
>
> Turns out xz is redundant because gunzip, gzcat and zcat all work.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

So Macos doesn't have a separate binary for xz, but makes gunzip handle
that format, too?

So would the following change make sense, or do we need more parameters
in the compressing case to make Macos gzip make an .xz archive?

diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index 6933a7c1d0..5a884c7ade 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -203,7 +203,7 @@ jka-compr-compression-info-list
   ;; can-append strip-extension-flag file-magic-bytes
   ;; uncompress-function]
   (mapcar 'purecopy
-  '(["\\.Z\\'"
+  `(["\\.Z\\'"
      "compressing"    "compress"     ("-c")
      ;; gzip is more common than uncompress. It can only read, not write.
      "uncompressing"  "gzip"   ("-c" "-q" "-d")
@@ -238,10 +238,15 @@ jka-compr-compression-info-list
      "LZMA compressing"   "lzma"         ("-c" "-q" "-z")
      "LZMA uncompressing" "lzma"         ("-c" "-q" "-d")
      t t ""]
-    ["\\.xz\\'"
-     "XZ compressing"     "xz"           ("-c" "-q")
-     "XZ uncompressing"   "xz"           ("-c" "-q" "-d")
-     t t "\3757zXZ\0"]
+    ,(if (featurep 'ns)
+         ["\\.xz\\'"
+          "XZ compressing"     "gzip"           ("-c" "-q")
+          "XZ uncompressing"   "gzip"           ("-c" "-q" "-d")
+          t t "\3757zXZ\0"]
+       ["\\.xz\\'"
+        "XZ compressing"     "xz"           ("-c" "-q")
+        "XZ uncompressing"   "xz"           ("-c" "-q" "-d")
+        t t "\3757zXZ\0"])
     ["\\.txz\\'"
      "XZ compressing"     "xz"           ("-c" "-q")
      "XZ uncompressing"   "xz"           ("-c" "-q" "-d")


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]