Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#64775 closed defect (fixed)

xar @1.8.0.452: No longer supports extracting to stdout

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc:
Port: xar

Description

xar @1.6.1 supported extracting to stdout with the -O / --to-stdout flag. Last year xar was switched to version 1.8.0.452 of Apple's xar, which does not support extracting to stdout. Any solution? I want to extract to stdout.

Change History (12)

comment:1 Changed 3 years ago by Schamschula (Marius Schamschula)

Hmm. The first I've heard of this issue.

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Assuming I have not overlooked some stdout capability in Apple's xar, possible solutions I see:

  • Add the stdout capability to Apple's xar.
  • Revert to mackyle's xar 1.6.1. (Apple's xar is already available at /usr/bin/xar.)
  • Offer two ports, one for Apple's xar and one for mackyle's xar.

comment:3 Changed 3 years ago by Schamschula (Marius Schamschula)

I think I'll try to add the patch to Apple xar.

If I can't make that work, I'll add a second port.

Note: both branches are not well supported upstream. Apple has clearly noted that there is no more development, and mackyle's hasn't see any updates for years as well.

comment:4 Changed 3 years ago by Schamschula (Marius Schamschula)

It looks like the patch fails 13 of 14 hunks. I don't have time right now to see if I can fix them. However, I'll get back to it soon.

comment:5 Changed 3 years ago by Schamschula (Marius Schamschula)

Unfortunately, I found the following https://github.com/mackyle/xar/issues/15 (see comment Jun. 5, 2017, by the owner). There are open issues including with openssl.

The Apple version has support (patches) from other platforms (Gentoo).

comment:6 Changed 3 years ago by Schamschula (Marius Schamschula)

In 3cc8ae1d99eab3c4b63e2c2fc14ba7b4d59b7f3e/macports-ports (master):

xar: add --to-stdout

See: #64775

comment:7 Changed 3 years ago by Schamschula (Marius Schamschula)

I have no xar archives handy for testing, hence I didn't close this ticket.

comment:8 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks!

You can create archives with xar for testing, for example:

$ echo hello world > test.txt
$ xar -cf test.xar test.txt

To extract to stdout:

$ xar -xOf test.xar

With mackyle's xar @1.6.1_6 the result is:

hello world

With Apple's xar @1.8.0.452_3 the result is:

--to-stdout requires a newer xar library

Looks like the whole concept of having different libxar library versions with different capabilities was added by mackyle too.

Since we know the library and program are provided as a matched set by the port, we could just dispense with the library version checking. When I do that, the result of trying to extract to stdout is that the -O flag is silently ignored; the file test.txt is created in the current directory.

I think the commit I mentioned at the beginning was only the part that modified the xar command line program to be able to use the to-stdout capability of the libxar library; we still need to patch that support into the library. I'll see if I can dig it up and send you the patch.

comment:9 in reply to:  8 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

the to-stdout capability of the libxar library

Looks like at least this commit is involved. I'll try to extract the relevant parts...

comment:10 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

comment:11 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 713c22863e4fe2624bc455f9bf6818118e53b987/macports-ports (master):

xar: Fix to-stdout functionality

Closes: #64775

comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Great! This functionality is used in the MacOSX10.12.sdk port and upcoming newer SDK ports.

Note: See TracTickets for help on using tickets.