From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1NWap9-0003B9-3o for garchives@archives.gentoo.org; Sun, 17 Jan 2010 19:30:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 56A76E0602; Sun, 17 Jan 2010 19:30:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 09F5EE0602 for ; Sun, 17 Jan 2010 19:30:07 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 8A05B65021 for ; Sun, 17 Jan 2010 19:30:06 +0000 (UTC) Received: from bangert by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1NWap3-0003VO-4x for gentoo-commits@lists.gentoo.org; Sun, 17 Jan 2010 19:30:05 +0000 From: "Thilo Bangert (bangert)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, bangert@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-arch/rzip/files: rzip-2.1-handle-broken-archive.patch rzip-2.1-darwin.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: rzip-2.1-handle-broken-archive.patch rzip-2.1-darwin.patch X-VCS-Directories: app-arch/rzip/files X-VCS-Committer: bangert X-VCS-Committer-Name: Thilo Bangert Content-Type: text/plain; charset=utf8 Message-Id: Sender: Thilo Bangert Date: Sun, 17 Jan 2010 19:30:05 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 04355a64-46f1-4dc9-8c56-165075aa971d X-Archives-Hash: 5ee6201128183b7a01e2420cfd020126 bangert 10/01/17 19:30:05 Added: rzip-2.1-handle-broken-archive.patch rzip-2.1-darwin.patch Log: add updated darwin.patch (-r1), also include ability to read broken arc= hives (-r2) (#217552) (Portage version: 2.2_rc61/cvs/Linux i686) Revision Changes Path 1.1 app-arch/rzip/files/rzip-2.1-handle-broken-archive.p= atch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/rzip/file= s/rzip-2.1-handle-broken-archive.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/rzip/file= s/rzip-2.1-handle-broken-archive.patch?rev=3D1.1&content-type=3Dtext/plai= n Index: rzip-2.1-handle-broken-archive.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff -ur rzip-2.1/main.c rzip-2.1-patched/main.c --- rzip-2.1/main.c 2006-02-14 01:38:23.000000000 +0100 +++ rzip-2.1-patched/main.c 2008-07-30 19:29:49.426926726 +0200 @@ -35,6 +35,7 @@ printf(" -k keep existing files\n"); printf(" -P show compression progress\n"); printf(" -L level set compression level\n"); + printf(" -l nr set higher bits of the expected file length = to nr\n"); printf(" -V show version\n"); #if 0 /* damn, this will be quite hard to do */ @@ -172,6 +173,13 @@ =20 =09 read_magic(fd_in, fd_out, &expected_size); + +#ifdef HAVE_LARGE_FILES + if (control->nr) { + expected_size =3D ( ((off_t)(control->nr))<<32) | (expected_size & 0xF= FFFFFFF); + } +#endif + runzip_fd(fd_in, fd_out, fd_hist, expected_size);=09 =09 if ((control->flags & FLAG_TEST_ONLY) =3D=3D 0) { @@ -267,7 +275,7 @@ control.flags |=3D FLAG_DECOMPRESS; } =20 - while ((c =3D getopt(argc, argv, "h0123456789dS:tVvkfPo:L:")) !=3D -1) = { + while ((c =3D getopt(argc, argv, "h0123456789dS:tVvkl:fPo:L:")) !=3D -1= ) { if (isdigit(c)) { control.compression_level =3D c - '0'; continue; @@ -295,6 +303,12 @@ case 'k': control.flags |=3D FLAG_KEEP_FILES; break; + case 'l': +#ifndef HAVE_LARGE_FILES + fatal("You used the -l option, but this rzip doesn't support large fi= les."); +#endif + control.nr =3D atoi(optarg); + break; case 'v': control.verbosity++; break; diff -ur rzip-2.1/runzip.c rzip-2.1-patched/runzip.c --- rzip-2.1/runzip.c 2003-10-08 00:08:28.000000000 +0200 +++ rzip-2.1-patched/runzip.c 2008-07-30 19:34:03.803564086 +0200 @@ -179,10 +179,16 @@ */ off_t runzip_fd(int fd_in, int fd_out, int fd_hist, off_t expected_size) { - off_t total =3D 0; - while (total < expected_size) { - total +=3D runzip_chunk(fd_in, fd_out, fd_hist); + off_t total =3D 0, fin=3D1; + while (fin && total < expected_size) { + fin =3D runzip_chunk(fd_in, fd_out, fd_hist); + total +=3D fin; } + + if (total < expected_size) { + fprintf(stderr, "Warning: The uncompressed size does not equal the exp= ected file size.\nHowever if you used the -l option, this may be okay.\n"= ); + } + return total; } =20 diff -ur rzip-2.1/rzip.h rzip-2.1-patched/rzip.h --- rzip-2.1/rzip.h 2006-02-14 01:38:23.000000000 +0100 +++ rzip-2.1-patched/rzip.h 2008-07-30 19:29:49.426926726 +0200 @@ -113,6 +113,7 @@ unsigned compression_level; unsigned flags; unsigned verbosity; + unsigned nr; }; =20 void fatal(const char *format, ...); 1.1 app-arch/rzip/files/rzip-2.1-darwin.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/rzip/file= s/rzip-2.1-darwin.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/rzip/file= s/rzip-2.1-darwin.patch?rev=3D1.1&content-type=3Dtext/plain Index: rzip-2.1-darwin.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff -r -uN rzip-2.1/configure.in rzip-2.1-patched/configure.in --- rzip-2.1/configure.in 2003-11-03 09:19:11.000000000 +0100 +++ rzip-2.1-patched/configure.in 2008-07-27 21:59:45.774740303 +0200 @@ -2,6 +2,12 @@ AC_INIT(main.c) AC_CONFIG_HEADER(config.h) =20 +# test prior to AC_PROG_CC, since it sets cflags on it's own. +if test x"CFLAGS" =3D x +then + DEFAULT_CFLAGS=3D"-g -Wall -O3" +fi + dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL @@ -9,10 +15,10 @@ AC_SYS_LARGEFILE =20 # Thanks to Martin Pool -if test x"$GCC" =3D xyes=20 +if test x"$GCC" =3D xyes && test x"$DEFAULT_CFLAGS" !=3D x then CFLAGS=3D"-g -Wall -O3" - AC_MSG_NOTICE([Setting gcc options: $CFLAGS]) + AC_MSG_RESULT([Setting default cflags: $CFLAGS]) fi =20 AC_CHECK_HEADERS(fcntl.h sys/time.h sys/unistd.h unistd.h) @@ -45,12 +51,8 @@ AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress, ,=20 AC_MSG_ERROR([Could not find bz2 library - please install libbz2= -devel])) =20 -echo $ac_n "checking for errno in errno.h... $ac_c" -AC_TRY_COMPILE([#include ],[int i =3D errno], -echo yes; AC_DEFINE(HAVE_ERRNO_DECL), -echo no) - AC_CHECK_FUNCS(mmap strerror) AC_CHECK_FUNCS(getopt_long) +AC_CHECK_FUNCS(strndup) =20 AC_OUTPUT(Makefile) diff -r -uN rzip-2.1/main.c rzip-2.1-patched/main.c --- rzip-2.1/main.c 2006-02-14 01:38:23.000000000 +0100 +++ rzip-2.1-patched/main.c 2008-07-27 22:00:28.298071207 +0200 @@ -18,6 +18,7 @@ /* rzip compression - main program */ =20 #include "rzip.h" +#include "strutils.h" =20 static void usage(void) { diff -r -uN rzip-2.1/Makefile.in rzip-2.1-patched/Makefile.in --- rzip-2.1/Makefile.in 2006-02-14 01:38:23.000000000 +0100 +++ rzip-2.1-patched/Makefile.in 2008-07-27 21:58:08.201419790 +0200 @@ -3,8 +3,8 @@ =20 prefix=3D@prefix@ exec_prefix=3D@exec_prefix@ -INSTALL_BIN=3D$(exec_prefix)/bin -INSTALL_MAN=3D$(prefix)/man +INSTALL_BIN=3D$(DESTDIR)/@bindir@ +INSTALL_MAN=3D$(DESTDIR)/@mandir@ =20 LIBS=3D@LIBS@ CC=3D@CC@ @@ -20,7 +20,7 @@ .SUFFIXES: .SUFFIXES: .c .o =20 -OBJS=3D rzip.o runzip.o main.o stream.o util.o crc32.o +OBJS=3D rzip.o runzip.o strutils.o main.o stream.o util.o crc32.o =20 # note that the -I. is needed to handle config.h when using VPATH .c.o: @@ -35,6 +35,7 @@ ${INSTALLCMD} -m 755 rzip ${INSTALL_BIN} -mkdir -p ${INSTALL_MAN}/man1 ${INSTALLCMD} -m 644 $(srcdir)/rzip.1 ${INSTALL_MAN}/man1/ + ln -s rzip $(INSTALL_BIN)/runzip =20 rzip: $(OBJS) $(CC) $(CFLAGS) -o rzip $(OBJS) $(LIBS) diff -r -uN rzip-2.1/rzip.h rzip-2.1-patched/rzip.h --- rzip-2.1/rzip.h 2006-02-14 01:38:23.000000000 +0100 +++ rzip-2.1-patched/rzip.h 2008-07-27 21:58:08.204752617 +0200 @@ -94,7 +94,7 @@ #define strerror(i) sys_errlist[i] #endif =20 -#ifndef HAVE_ERRNO_DECL +#if !defined(errno) extern int errno; #endif =20 diff -r -uN rzip-2.1/strutils.c rzip-2.1-patched/strutils.c --- rzip-2.1/strutils.c 1970-01-01 01:00:00.000000000 +0100 +++ rzip-2.1-patched/strutils.c 2008-07-27 21:58:08.204752617 +0200 @@ -0,0 +1,29 @@ +/*=20 + Copyright (C) 2005 Gentoo Foundation + =20 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + =20 + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + =20 + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* string utilities that may be missing on various platforms */ + +#include "strutils.h" + +#ifndef HAVE_STRNDUP +char* strndup(const char* s, size_t n) { + char* ret =3D malloc(n + 1); + if (ret =3D=3D NULL) return(ret); + ret[n] =3D '\0'; + return(memcpy(ret, s, n)); +} +#endif diff -r -uN rzip-2.1/strutils.h rzip-2.1-patched/strutils.h --- rzip-2.1/strutils.h 1970-01-01 01:00:00.000000000 +0100 +++ rzip-2.1-patched/strutils.h 2008-07-27 21:58:08.204752617 +0200 @@ -0,0 +1,31 @@ +/*=20 + Copyright (C) 2005 Gentoo Foundation + =20 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + =20 + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + =20 + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* string utilities that may be missing on various platforms */ + +#ifndef _HEADER_STRUTIL +#define _HEADER_STRUTIL 1 + +#include +#include +#include "config.h" + +# ifndef HAVE_STRNDUP +char* strndup(const char* s, size_t n); +# endif + +#endif