diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-10-30 05:33:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-10-30 05:33:27 +0000 |
commit | ba82b4dfcf5204c8bbbc661d8d7fecb5638ac3f6 (patch) | |
tree | f8398281357afbfa048ff9b963a6edd560067332 /app-arch | |
parent | old (diff) | |
download | gentoo-2-ba82b4dfcf5204c8bbbc661d8d7fecb5638ac3f6.tar.gz gentoo-2-ba82b4dfcf5204c8bbbc661d8d7fecb5638ac3f6.tar.bz2 gentoo-2-ba82b4dfcf5204c8bbbc661d8d7fecb5638ac3f6.zip |
Old ebuild wasnt applying all patches, so fix that, clean up build process, and add support for detecting errors when an LHA archive has CRC errors.
(Portage version: 2.0.53_rc6)
Diffstat (limited to 'app-arch')
-rw-r--r-- | app-arch/lha/ChangeLog | 12 | ||||
-rw-r--r-- | app-arch/lha/files/digest-lha-114i-r5 | 1 | ||||
-rw-r--r-- | app-arch/lha/files/lha-114i-build.patch | 50 | ||||
-rw-r--r-- | app-arch/lha/files/lha-114i-detect-cmd-extract-fail.patch | 150 | ||||
-rw-r--r-- | app-arch/lha/lha-114i-r5.ebuild | 39 |
5 files changed, 250 insertions, 2 deletions
diff --git a/app-arch/lha/ChangeLog b/app-arch/lha/ChangeLog index 730d97dc3ec8..140a962fa138 100644 --- a/app-arch/lha/ChangeLog +++ b/app-arch/lha/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-arch/lha -# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/lha/ChangeLog,v 1.23 2005/01/01 11:47:30 eradicator Exp $ +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/lha/ChangeLog,v 1.24 2005/10/30 05:33:27 vapier Exp $ + +*lha-114i-r5 (30 Oct 2005) + + 30 Oct 2005; Mike Frysinger <vapier@gentoo.org> + +files/lha-114i-build.patch, + +files/lha-114i-detect-cmd-extract-fail.patch, +lha-114i-r5.ebuild: + Old ebuild wasnt applying all patches, so fix that, clean up build process, + and add support for detecting errors when an LHA archive has CRC errors. 01 Nov 2004; Mamoru KOMACHI <usata@gentoo.org> lha-114i-r4.ebuild: Stable on ppc-macos. diff --git a/app-arch/lha/files/digest-lha-114i-r5 b/app-arch/lha/files/digest-lha-114i-r5 new file mode 100644 index 000000000000..44da31fd5180 --- /dev/null +++ b/app-arch/lha/files/digest-lha-114i-r5 @@ -0,0 +1 @@ +MD5 5225884d557b91f04124693e2c5c9e94 lha-114i.tar.gz 64608 diff --git a/app-arch/lha/files/lha-114i-build.patch b/app-arch/lha/files/lha-114i-build.patch new file mode 100644 index 000000000000..23d241ff73ed --- /dev/null +++ b/app-arch/lha/files/lha-114i-build.patch @@ -0,0 +1,50 @@ +--- Makefile ++++ Makefile +@@ -23,14 +23,15 @@ + MACHINE = -DSYSTIME_HAS_NO_TM -DEUC -DSYSV_SYSTEM_DIR -DMKTIME + + #OPTIMIZE = -O2 -fstrength-reduce -fomit-frame-pointer +-OPTIMIZE = -O2 -DSUPPORT_LH7 -DMKSTEMP ++OPTIMIZE = $(CFLAGS) -DSUPPORT_LH7 -DMKSTEMP + +-BINDIR = /usr/local/bin +-MANDIR = /usr/local/man +-MANSECT = n ++DESTDIR = ++BINDIR = /usr/bin ++MANDIR = /usr/share/man/ja ++MANSECT = 1 + + INSTALL = install +-INSTALLBIN = -s -m 755 ++INSTALLBIN = -m 755 + INSTALLMAN = -m 644 + + SUBDIRS = src man +@@ -42,6 +43,7 @@ + LIBRARYOBJS = patmatch$(O) + + MYMAKEFLAGS = 'BINDIR=$(BINDIR)' 'MANDIR=$(MANDIR)' 'MANSECT=$(MANSECT)'\ ++ 'DESTDIR=$(DESTDIR)' \ + 'INSTALL=$(INSTALL)' 'INSTALLBIN=$(INSTALLBIN)' 'INSTALLMAN=$(INSTALLMAN)'\ + 'CC=$(CC)' 'SWITCHES=$(SWITCHES)' 'O=$(O)' 'LIBRARYOBJS=$(LIBRARYOBJS)' \ + 'OPTIMIZE=$(OPTIMIZE)' 'MACHINE=$(MACHINE)' +--- man/Makefile ++++ man/Makefile +@@ -11,7 +11,7 @@ + $(NROFF) -man lha.n > lha.man + + install: +- $(INSTALL) $(INSTALLMAN) lha.n $(MANDIR)/man$(MANSECT)/lha.$(MANSECT) ++ $(INSTALL) -D $(INSTALLMAN) lha.n $(DESTDIR)$(MANDIR)/man$(MANSECT)/lha.$(MANSECT) + + clean: + rm -f *~ +--- src/Makefile ++++ src/Makefile +@@ -49,4 +49,4 @@ + rm -f core *.o lha.tar lha.tar.Z *~ \#* *.orig + + install: +- $(INSTALL) $(INSTALLBIN) lha $(BINDIR)/lha ++ $(INSTALL) -D $(INSTALLBIN) lha $(DESTDIR)$(BINDIR)/lha diff --git a/app-arch/lha/files/lha-114i-detect-cmd-extract-fail.patch b/app-arch/lha/files/lha-114i-detect-cmd-extract-fail.patch new file mode 100644 index 000000000000..72373162a510 --- /dev/null +++ b/app-arch/lha/files/lha-114i-detect-cmd-extract-fail.patch @@ -0,0 +1,150 @@ +Make sure that a corrupt archive file will return failure when we try +and extract it + +patch by Mike Frysinger <vapier@gentoo.org> + +--- lha-114i/src/lha.h ++++ lha-114i/src/lha.h +@@ -231,5 +231,6 @@ + extern long copyfile(); + +-extern void cmd_list(), cmd_extract(), cmd_add(), cmd_delete(); ++extern void cmd_list(), cmd_add(), cmd_delete(); ++extern int cmd_extract(); + + extern boolean ignore_directory; +--- lha-114i/src/lharc.c ++++ lha-114i/src/lharc.c +@@ -431,5 +431,5 @@ + switch (cmd) { + case CMD_EXTRACT: +- cmd_extract(); ++ return cmd_extract(); + break; + case CMD_ADD: +--- lha-114i/src/lhext.c ++++ lha-114i/src/lhext.c +@@ -175,5 +175,5 @@ + + /* ------------------------------------------------------------------------ */ +-static void ++static int + extract_one(afp, hdr) + FILE *afp; /* archive file */ +@@ -226,5 +226,5 @@ + if (methods[method] == NULL) { + error("Unknown method skiped ...", name); +- return; ++ return 1; + } + if (bcmp(hdr->method, methods[method], 5) == 0) +@@ -255,5 +255,5 @@ + fgetc(afp); + } +- return; ++ return 0; + } + +@@ -279,5 +279,5 @@ + up_flag = inquire_extract(name); + if (up_flag == FALSE && force == FALSE) { +- return; ++ return 0; + } + } +@@ -288,5 +288,5 @@ + if (quiet != TRUE) + printf("%s : Skipped...\n", name); +- return; ++ return 0; + } + } +@@ -298,5 +298,5 @@ + fgetc(afp); + } +- return; ++ return 0; + } + +@@ -318,10 +318,12 @@ + + if (!fp) +- return; ++ return 0; + } + + errno = 0; +- if (hdr->has_crc && crc != hdr->crc) ++ if (hdr->has_crc && crc != hdr->crc) { + error("CRC error", name); ++ return 1; ++ } + } + else if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) == UNIX_FILE_DIRECTORY +@@ -333,5 +335,5 @@ + if (quiet != TRUE) + printf("EXTRACT %s (directory)\n", name); +- return; ++ return 0; + } + /* NAME has trailing SLASH '/', (^_^) */ +@@ -348,5 +350,5 @@ + up_flag = inquire_extract(name); + if (up_flag == FALSE && force == FALSE) { +- return; ++ return 0; + } + } else { +@@ -355,5 +357,5 @@ + if (quiet != TRUE) + printf("%s : Skipped...\n", bb1); +- return; ++ return 0; + } + } +@@ -375,9 +377,9 @@ + sprintf(buf, sizeof(buf), "%s -> %s", bb1, bb2); + warning("Can't make Symbolic Link", buf); +- return; ++ return 0; + #endif + } else { /* make directory */ + if (!output_to_stdout && !make_parent_path(name)) +- return; ++ return 0; + } + } +@@ -389,4 +391,6 @@ + if (!output_to_stdout) + adjust_info(name, hdr); ++ ++ return 0; + } + +@@ -394,5 +398,5 @@ + /* EXTRACT COMMAND MAIN */ + /* ------------------------------------------------------------------------ */ +-void ++int + cmd_extract() + { +@@ -400,4 +404,5 @@ + long pos; + FILE *afp; ++ int ret = 0; + + /* open archive file */ +@@ -412,5 +417,5 @@ + if (need_file(hdr.name)) { + pos = ftell(afp); +- extract_one(afp, &hdr); ++ ret += extract_one(afp, &hdr); + fseek(afp, pos + hdr.packed_size, SEEK_SET); + } else { +@@ -428,5 +433,5 @@ + fclose(afp); + +- return; ++ return ret; + } + diff --git a/app-arch/lha/lha-114i-r5.ebuild b/app-arch/lha/lha-114i-r5.ebuild new file mode 100644 index 000000000000..4d214e429cd4 --- /dev/null +++ b/app-arch/lha/lha-114i-r5.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/lha/lha-114i-r5.ebuild,v 1.1 2005/10/30 05:33:27 vapier Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="Utility for creating and opening lzh archives" +HOMEPAGE="http://www2m.biglobe.ne.jp/~dolphin/lha/lha-unix.htm" +SRC_URI="http://www2m.biglobe.ne.jp/~dolphin/lha/prog/${P}.tar.gz" + +LICENSE="lha" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc-macos ppc64 s390 sparc x86" +IUSE="" + +DEPEND="" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-malloc.patch + epatch "${FILESDIR}"/${P}-sec.patch + epatch "${FILESDIR}"/${P}-sec2.patch + epatch "${FILESDIR}"/${P}-symlink.patch + epatch "${FILESDIR}"/${P}-dir_length_bounds_check.patch + epatch "${FILESDIR}"/${P}-build.patch + epatch "${FILESDIR}"/${P}-detect-cmd-extract-fail.patch +} + +src_compile() { + use ppc-macos && append-flags -DHAVE_NO_LCHOWN + emake || die +} + +src_install() { + make install DESTDIR="${D}" || die + use linguas_jp || rm -r "${D}"/usr/share/man + dodoc *.txt *.euc *.eng +} |