[vlc-devel] [vlc-commits] Contribs: fix xz for OSX

Rémi Denis-Courmont remi at remlab.net
Tue Nov 15 19:12:37 CET 2011


Le mardi 15 novembre 2011 18:20:14 Rémi Denis-Courmont, vous avez écrit :
> Le mardi 15 novembre 2011 17:33:14 Jean-Baptiste Kempf, vous avez écrit :
> > vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Nov 15
> > 15:04:56 2011 +0100| [2ce437a18f45f742aea39fc8d2da83a7574b1ae2] |
> > committer: Jean-Baptiste Kempf
> > 
> > Contribs: fix xz for OSX
> 
> Generally, piping in Makefiles is a bad idea. Given how shell scripting
> works, make gets the exit code of only the last process in the pipeline,
> in this case the compression tool. If another process in the pipeline
> fails, the error is ignored. Then xz generates an incomplete output file
> and the build fails non- recoverably.
> 
> I have not found any easy fix, though I admit I have barely looked for one.

I found two potential solutions. First one would look ugly like this:

mkfifo /tmp/tar.$$ ; \
tar cv test > /tmp/tar.$$ & \
xz < /tmp/tar.$$ > $OUTPUT.tar.xz & \
rm -f /tmp/tar.$$ ; \
wait %2 && wait %1

The second one is bzip2 or gzip -9.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list