public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0 of 1] using tar with xz and lzma archives
@ 2011-11-17 14:30 Titus von Boxberg
  2011-11-17 14:30 ` [PATCH 1 of 1] scripts/functions: tar: use -J or --lzma instead of --use-compress-program Titus von Boxberg
  2011-11-17 18:46 ` [PATCH 0 of 1] using tar with xz and lzma archives Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Titus von Boxberg @ 2011-11-17 14:30 UTC (permalink / raw)
  To: crossgcc

Yann, all,

on my machine tar --use-decompress-program does not work.
However, -J or --lzma does work.

Comments welcome.

Regards
Titus

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1 of 1] scripts/functions: tar: use -J or --lzma instead of --use-compress-program
  2011-11-17 14:30 [PATCH 0 of 1] using tar with xz and lzma archives Titus von Boxberg
@ 2011-11-17 14:30 ` Titus von Boxberg
  2011-11-17 18:46 ` [PATCH 0 of 1] using tar with xz and lzma archives Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Titus von Boxberg @ 2011-11-17 14:30 UTC (permalink / raw)
  To: crossgcc

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1321536971 -3600
# Node ID fc86fec6decf00a6162a825de384af2e4edfdc5b
# Parent  3c1a3fc051cb46d1bad9cbe2a601c5c4aa48876c
scripts/functions: tar: use -J or --lzma instead of --use-compress-program

The former works portably, the latter not.

Signed-off-by: titus@v9g.de

diff -r 3c1a3fc051cb -r fc86fec6decf scripts/functions
--- a/scripts/functions	Thu Nov 17 14:18:44 2011 +0100
+++ b/scripts/functions	Thu Nov 17 14:36:11 2011 +0100
@@ -712,7 +712,7 @@
     local nochdir="$1"
     local basename
     local ext
-    local lzma_prog
+    local lzma_opt
     local -a tar_opts
 
     if [ "${nochdir}" = "nochdir" ]; then
@@ -761,13 +761,13 @@
     # - so, if we get an lzma tarball, and either 'xz' or 'lzma' is
     #   missing, we can assume the other is available
     if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then
-        lzma_prog=lzma
+        lzma_opt=--lzma
     else
-        lzma_prog=xz
+        lzma_opt=-J
     fi
     case "${ext}" in
-        .tar.xz)      CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program=xz -f "${full_file}";;
-        .tar.lzma)    CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program="${lzma_prog}" -f "${full_file}";;
+        .tar.xz)      CT_DoExecLog FILE tar "${tar_opts[@]}" -J -f "${full_file}";;
+        .tar.lzma)    CT_DoExecLog FILE tar "${tar_opts[@]}" ${lzma_opt} -f "${full_file}";;
         .tar.bz2)     CT_DoExecLog FILE tar "${tar_opts[@]}" -j -f "${full_file}";;
         .tar.gz|.tgz) CT_DoExecLog FILE tar "${tar_opts[@]}" -z -f "${full_file}";;
         .tar)         CT_DoExecLog FILE tar "${tar_opts[@]}" -f "${full_file}";;

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0 of 1] using tar with xz and lzma archives
  2011-11-17 14:30 [PATCH 0 of 1] using tar with xz and lzma archives Titus von Boxberg
  2011-11-17 14:30 ` [PATCH 1 of 1] scripts/functions: tar: use -J or --lzma instead of --use-compress-program Titus von Boxberg
@ 2011-11-17 18:46 ` Yann E. MORIN
  2011-11-18 11:16   ` Titus von Boxberg
  1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2011-11-17 18:46 UTC (permalink / raw)
  To: crossgcc; +Cc: Titus von Boxberg

Titus, All,

On Thursday 17 November 2011 15:27:23 Titus von Boxberg wrote:
> on my machine tar --use-decompress-program does not work.

What tar is this?

(Note: this is --use-compress-program, not --use-_de_compress-program)

GNU tar supports --use-compress-program since at least 2004.

The tar in MacOS-X does document this option:
https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/tar.1.html

> However, -J or --lzma does work.

The -J was introduced 2008-12-27 in GNU tar, so it is not supported by
Debian Lenny (the previous stable, still widely used), so this can't be
used. --lzma is also relatively recent, it was added 2008-04-14 (still
in GNU tar).

The tar in MacOS-X supports neither -J nor --lzma, so neither is portable.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0 of 1] using tar with xz and lzma archives
  2011-11-17 18:46 ` [PATCH 0 of 1] using tar with xz and lzma archives Yann E. MORIN
@ 2011-11-18 11:16   ` Titus von Boxberg
  0 siblings, 0 replies; 4+ messages in thread
From: Titus von Boxberg @ 2011-11-18 11:16 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

Am 17.11.2011 um 19:46 schrieb Yann E. MORIN:

> Titus, All,
> 
> On Thursday 17 November 2011 15:27:23 Titus von Boxberg wrote:
>> on my machine tar --use-decompress-program does not work.
> 
> What tar is this?
> 
> (Note: this is --use-compress-program, not --use-_de_compress-program)
this is bsdtar 2.6.2 on 10.6 and bsdtar 2.8.3 on 10.7

> 
> GNU tar supports --use-compress-program since at least 2004.
> 
> The tar in MacOS-X does document this option:
> https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/tar.1.html
> 
>> However, -J or --lzma does work.
correction: -J and --lzma only work with bsdtar 2.8.3 on 10.7
tar on 10.6 seems to not understand any of these options.

I assume that
- the man page is not appropriate for the implementation
- the implementation on OSX 10.7 is buggy since it does
  accept the --use-compress-program but fails.

Now, if also Lenny is not really up to date,
I'd say the most compatible way would be 
to (always) use
<compressor> -dc | tar -f -

What do you think?

Regards
Titus


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-18 11:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 14:30 [PATCH 0 of 1] using tar with xz and lzma archives Titus von Boxberg
2011-11-17 14:30 ` [PATCH 1 of 1] scripts/functions: tar: use -J or --lzma instead of --use-compress-program Titus von Boxberg
2011-11-17 18:46 ` [PATCH 0 of 1] using tar with xz and lzma archives Yann E. MORIN
2011-11-18 11:16   ` Titus von Boxberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).