wok rev 14221

busybox: unxz patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 19 08:39:54 2013 +0100 (2013-03-19)
parents 6d11967fcb51
children ac6fab7853e3
files busybox/receipt busybox/stuff/busybox-1.21-xz.u get-LibreOffice/stuff/get-LibreOffice gv/receipt
line diff
     1.1 --- a/busybox/receipt	Mon Mar 18 20:48:03 2013 +0100
     1.2 +++ b/busybox/receipt	Tue Mar 19 08:39:54 2013 +0100
     1.3 @@ -40,6 +40,7 @@
     1.4  cmdline.u
     1.5  diff.u
     1.6  nfs-segfault.u
     1.7 +xz.u
     1.8  EOT
     1.9      cp $stuff/$PACKAGE-${VERSION%.*}.config .config
    1.10  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/busybox/stuff/busybox-1.21-xz.u	Tue Mar 19 08:39:54 2013 +0100
     2.3 @@ -0,0 +1,84 @@
     2.4 +--- busybox-1.21.0/archival/libarchive/decompress_unxz.c
     2.5 ++++ busybox-1.21.0/archival/libarchive/decompress_unxz.c
     2.6 +@@ -40,6 +40,7 @@ static uint32_t xz_crc32(const uint8_t *
     2.7 + IF_DESKTOP(long long) int FAST_FUNC
     2.8 + unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
     2.9 + {
    2.10 ++	enum xz_ret xz_result;
    2.11 + 	struct xz_buf iobuf;
    2.12 + 	struct xz_dec *state;
    2.13 + 	unsigned char *membuf;
    2.14 +@@ -63,9 +64,8 @@ unpack_xz_stream(transformer_aux_data_t
    2.15 + 	/* Limit memory usage to about 64 MiB. */
    2.16 + 	state = xz_dec_init(XZ_DYNALLOC, 64*1024*1024);
    2.17 + 
    2.18 ++	xz_result = X_OK;
    2.19 + 	while (1) {
    2.20 +-		enum xz_ret r;
    2.21 +-
    2.22 + 		if (iobuf.in_pos == iobuf.in_size) {
    2.23 + 			int rd = safe_read(src_fd, membuf, BUFSIZ);
    2.24 + 			if (rd < 0) {
    2.25 +@@ -73,28 +73,57 @@ unpack_xz_stream(transformer_aux_data_t
    2.26 + 				total = -1;
    2.27 + 				break;
    2.28 + 			}
    2.29 ++			if (rd == 0 && xz_result == XZ_STREAM_END)
    2.30 ++				break;
    2.31 + 			iobuf.in_size = rd;
    2.32 + 			iobuf.in_pos = 0;
    2.33 + 		}
    2.34 ++		if (xz_result == XZ_STREAM_END) {
    2.35 ++			/*
    2.36 ++			 * Try to start decoding next concatenated stream.
    2.37 ++			 * Stream padding must always be a multiple of four
    2.38 ++			 * bytes to preserve four-byte alignment. To keep the
    2.39 ++			 * code slightly smaller, we aren't as strict here as
    2.40 ++			 * the .xz spec requires. We just skip all zero-bytes
    2.41 ++			 * without checking the alignment and thus can accept
    2.42 ++			 * files that aren't valid, e.g. the XZ utils test
    2.43 ++			 * files bad-0pad-empty.xz and bad-0catpad-empty.xz.
    2.44 ++			 */
    2.45 ++			do {
    2.46 ++				if (membuf[iobuf.in_pos] != 0) {
    2.47 ++					xz_dec_reset(state);
    2.48 ++					goto do_run;
    2.49 ++				}
    2.50 ++				iobuf.in_pos++;
    2.51 ++			} while (iobuf.in_pos < iobuf.in_size);
    2.52 ++		}
    2.53 ++ do_run:
    2.54 + //		bb_error_msg(">in pos:%d size:%d out pos:%d size:%d",
    2.55 + //				iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size);
    2.56 +-		r = xz_dec_run(state, &iobuf);
    2.57 ++		xz_result = xz_dec_run(state, &iobuf);
    2.58 + //		bb_error_msg("<in pos:%d size:%d out pos:%d size:%d r:%d",
    2.59 +-//				iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, r);
    2.60 ++//				iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, xz_result);
    2.61 + 		if (iobuf.out_pos) {
    2.62 + 			xwrite(dst_fd, iobuf.out, iobuf.out_pos);
    2.63 + 			IF_DESKTOP(total += iobuf.out_pos;)
    2.64 + 			iobuf.out_pos = 0;
    2.65 + 		}
    2.66 +-		if (r == XZ_STREAM_END) {
    2.67 +-			break;
    2.68 ++		if (xz_result == XZ_STREAM_END) {
    2.69 ++			/*
    2.70 ++			 * Can just "break;" here, if not for concatenated
    2.71 ++			 * .xz streams.
    2.72 ++			 * Checking for padding may require buffer
    2.73 ++			 * replenishment. Can't do it here.
    2.74 ++			 */
    2.75 ++			continue;
    2.76 + 		}
    2.77 +-		if (r != XZ_OK && r != XZ_UNSUPPORTED_CHECK) {
    2.78 ++		if (xz_result != XZ_OK && xz_result != XZ_UNSUPPORTED_CHECK) {
    2.79 + 			bb_error_msg("corrupted data");
    2.80 + 			total = -1;
    2.81 + 			break;
    2.82 + 		}
    2.83 + 	}
    2.84 ++
    2.85 + 	xz_dec_end(state);
    2.86 + 	free(membuf);
    2.87 + 
     3.1 --- a/get-LibreOffice/stuff/get-LibreOffice	Mon Mar 18 20:48:03 2013 +0100
     3.2 +++ b/get-LibreOffice/stuff/get-LibreOffice	Tue Mar 19 08:39:54 2013 +0100
     3.3 @@ -26,7 +26,6 @@
     3.4  VER="${VERSION/\-/}" # without hyphens
     3.5  
     3.6  
     3.7 -#http://download.documentfoundation.org/libreoffice/stable/4.0.1/rpm/x86/LibreOffice_4.0.1_Linux_x86_rpm.tar.gz
     3.8  TARBALL="${PREFIX}_${VER}_${SUFFIX}"
     3.9  
    3.10  for LOC in ${LANG/_/-} ${LANG%_*}; do
    3.11 @@ -191,24 +190,23 @@
    3.12  
    3.13  post_install()
    3.14  {
    3.15 -	cd /usr/share/applications
    3.16 -	ln -s /usr/lib/libreoffice?*/share/xdg/base.desktop          libreoffice-base.desktop
    3.17 -	ln -s /usr/lib/libreoffice?*/share/xdg/impress.desktop       libreoffice-impress.desktop
    3.18 -	ln -s /usr/lib/libreoffice?*/share/xdg/writer.desktop        libreoffice-writer.desktop
    3.19 -	ln -s /usr/lib/libreoffice?*/share/xdg/calc.desktop          libreoffice-calc.desktop
    3.20 -	ln -s /usr/lib/libreoffice?*/share/xdg/math.desktop          libreoffice-math.desktop
    3.21 -	ln -s /usr/lib/libreoffice?*/share/xdg/draw.desktop          libreoffice-draw.desktop
    3.22 -	ln -s /usr/lib/libreoffice?*/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop
    3.23 -	chmod +x /usr/lib/libreoffice?*/share/xdg/*.desktop
    3.24 +	cd \$1/usr/share/applications
    3.25 +	ln -s /usr/lib/libreoffice*/share/xdg/base.desktop          libreoffice-base.desktop
    3.26 +	ln -s /usr/lib/libreoffice*/share/xdg/impress.desktop       libreoffice-impress.desktop
    3.27 +	ln -s /usr/lib/libreoffice*/share/xdg/writer.desktop        libreoffice-writer.desktop
    3.28 +	ln -s /usr/lib/libreoffice*/share/xdg/calc.desktop          libreoffice-calc.desktop
    3.29 +	ln -s /usr/lib/libreoffice*/share/xdg/math.desktop          libreoffice-math.desktop
    3.30 +	ln -s /usr/lib/libreoffice*/share/xdg/draw.desktop          libreoffice-draw.desktop
    3.31 +	ln -s /usr/lib/libreoffice*/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop
    3.32 +	chmod +x /usr/lib/libreoffice*/share/xdg/*.desktop
    3.33  
    3.34 -	cd /usr/bin
    3.35 -	ln -s /usr/lib/libreoffice?* /usr/lib/libreoffice
    3.36 +	cd \$1/usr/bin
    3.37  	ln -sf /usr/lib/libreoffice/program/soffice
    3.38  }
    3.39  
    3.40  post_remove()
    3.41  {
    3.42 -	rm -f /usr/share/applications/libreoffice-*
    3.43 +	rm -f \$1/usr/share/applications/libreoffice-*
    3.44  }
    3.45  
    3.46  EOT
     4.1 --- a/gv/receipt	Mon Mar 18 20:48:03 2013 +0100
     4.2 +++ b/gv/receipt	Tue Mar 19 08:39:54 2013 +0100
     4.3 @@ -7,7 +7,6 @@
     4.4  MAINTAINER="pascal.bellard@slitaz.org"
     4.5  TARBALL="$PACKAGE-$VERSION.tar.gz"
     4.6  WEB_SITE="http://www.gnu.org/software/gv/"
     4.7 -
     4.8  WGET_URL="http://ftp.gnu.org/gnu/gv/$TARBALL"
     4.9  
    4.10  DEPENDS="ghostscript xorg-libXaw3d xorg-libXinerama"
    4.11 @@ -21,7 +20,7 @@
    4.12  		--prefix=/usr \
    4.13  		$CONFIGURE_ARGS &&
    4.14  	make $MAKEFLAGS &&
    4.15 -	make DESTDIR=$DESTDIR install soinstall
    4.16 +	make DESTDIR=$DESTDIR install
    4.17  }
    4.18  
    4.19  # Rules to gen a SliTaz package suitable for Tazpkg.