update to unrarsrc 3.2.1 (but it's called 3.20beta3 internally?!)

This update is based on an update by naddy@ done earlier this year.
I updated that to the current version and fixed sparc64 by disallowing
exceptions (otherwise core dumps would occur). I got some feedback from
wilfried@.

Main changes in the program are a seemingly total rewrite in C++ with
support for newer versions of the RAR algorithm (well, newer files that
didn't uncompress with the old unrar, uncompress with this).
This commit is contained in:
sturm 2003-04-16 20:59:17 +00:00
parent 02b9757f46
commit 44dc3775bd
7 changed files with 67 additions and 92 deletions

View File

@ -1,25 +1,36 @@
# $OpenBSD: Makefile,v 1.18 2002/12/29 15:15:18 fgsch Exp $
# $OpenBSD: Makefile,v 1.19 2003/04/16 20:59:17 sturm Exp $
COMMENT= "extract, list & test RAR archives"
COMMENT= "extract, list, and test RAR archives"
DISTNAME= unrar-2.50
DISTNAME= unrarsrc-3.2.1
PKGNAME= unrar-3.20beta3
CATEGORIES= archivers
MASTER_SITES= ftp://ftp.kiarchive.ru/pub/unix/arcers/
HOMEPAGE= http://www.rarlab.com/
PERMIT_PACKAGE_CDROM= "no fee"
PERMIT_PACKAGE_FTP= "may not modify"
PERMIT_DISTFILES_CDROM= "no fee"
PERMIT_DISTFILES_FTP= Yes
WRKDIST= ${WRKDIR}
MASTER_SITES= ${HOMEPAGE}rar/
do-build:
cd ${WRKSRC}; ${CC} ${CFLAGS} -D_UNIX unrar.c -o unrar
# - work around optimizer bug in gcc 2.95
# - exceptions don't work on sparc64
.if ${MACHINE_ARCH} == "sparc64"
PATCH_LIST= patch-* gcc-patch-*
.endif
WRKDIST= ${WRKDIR}/unrar
MAKE_FILE= makefile.unix
MAKE_FLAGS= CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" DEFINES=""
do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/unrar ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/unrar
cd ${WRKSRC}; ${INSTALL_PROGRAM} unrar ${PREFIX}/bin
cd ${WRKSRC}; ${INSTALL_MAN} readme.txt license.txt ${PREFIX}/share/doc/unrar
${INSTALL_MAN} ${WRKSRC}/readme.txt ${WRKSRC}/license.txt \
${PREFIX}/share/doc/unrar
NO_REGRESS= Yes

View File

@ -1,3 +1,3 @@
MD5 (unrar-2.50.tar.gz) = ac92453b6e1c3bd1d0a8fb36b1eb371f
RMD160 (unrar-2.50.tar.gz) = 517bddfae2bb9c1eab41184f2f585424b840933b
SHA1 (unrar-2.50.tar.gz) = 0a8343d335ea6777aae3233784c78f974bacc781
MD5 (unrarsrc-3.2.1.tar.gz) = f0a55e2666061f315aec04994f79ff45
RMD160 (unrarsrc-3.2.1.tar.gz) = c1c1ef31c6e97fa001551e059b596efd3492d1bb
SHA1 (unrarsrc-3.2.1.tar.gz) = 8d5fc4791dd777b90e9ddf7616b352751614b144

View File

@ -0,0 +1,11 @@
$OpenBSD: gcc-patch-errhnd_hpp,v 1.1 2003/04/16 20:59:18 sturm Exp $
--- errhnd.hpp.orig Tue Apr 15 22:24:57 2003
+++ errhnd.hpp Tue Apr 15 22:27:07 2003
@@ -2,7 +2,6 @@
#define _RAR_ERRHANDLER_
#if (defined(GUI) || !defined(_WIN_32)) && !defined(SFX_MODULE) || defined(RARDLL)
-#define ALLOW_EXCEPTIONS
#endif
enum { SUCCESS,WARNING,FATAL_ERROR,CRC_ERROR,LOCK_ERROR,WRITE_ERROR,

View File

@ -0,0 +1,12 @@
$OpenBSD: gcc-patch-makefile_unix,v 1.1 2003/04/16 20:59:18 sturm Exp $
--- makefile.unix.orig Sat Dec 14 16:09:01 2002
+++ makefile.unix Sat Dec 14 16:09:44 2002
@@ -41,6 +41,8 @@ OBJECTS=rar.o strlist.o strfn.o pathfn.o
.cpp.o:
$(COMPILE) -D$(WHAT) -c $<
+sha1.o: sha1.cpp
+ $(COMPILE) -O0 -c $?
all: unrar

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-makefile_unix,v 1.1 2003/04/16 20:59:18 sturm Exp $
--- makefile.unix.orig Fri Jan 3 19:14:22 2003
+++ makefile.unix Mon Apr 14 21:50:54 2003
@@ -48,6 +48,8 @@ OBJECTS=rar.o strlist.o strfn.o pathfn.o
resource.o match.o timefn.o rdwrfn.o consio.o options.o ulinks.o errhnd.o rarvm.o \
rijndael.o getbits.o sha1.o extinfo.o extract.o volume.o list.o find.o unpack.o cmddata.o
+.SUFFIXES: .cpp
+
.cpp.o:
$(COMPILE) -D$(WHAT) -c $<
@@ -56,7 +58,7 @@ all: unrar
clean:
@rm -f *.o *.bak *~
-unrar: WHAT=UNRAR
+WHAT=UNRAR
unrar: $(OBJECTS) $(UNRAR_OBJ)
@rm -f makeunrar
$(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)

View File

@ -1,52 +0,0 @@
--- os.c.orig Sat Apr 17 10:53:01 1999
+++ os.c Sun Mar 26 17:40:24 2000
@@ -82,7 +82,10 @@
SetConsoleMode(hConIn,ConInMode);
SetConsoleMode(hConOut,ConOutMode);
#else
+ char *s;
fgets(Str,sizeof(Password)-1,stdin);
+ if ((s = strchr(Str, '\n')) != NULL)
+ *s = '\0';
#endif
}
@@ -408,26 +411,33 @@
}
#endif
#ifdef _UNIX
+ static mode_t mask = -1;
+
+ if (mask == (mode_t) -1)
+ {
+ mask = umask(022);
+ (void) umask(mask);
+ }
switch(NewLhd.HostOS)
{
case MS_DOS:
case OS2:
case WIN_32:
if (NewLhd.FileAttr & 0x10)
- NewLhd.FileAttr=0x41ff;
+ NewLhd.FileAttr=0x41ff & ~mask;
else
if (NewLhd.FileAttr & 1)
- NewLhd.FileAttr=0x816d;
+ NewLhd.FileAttr=0x8124 & ~mask;
else
- NewLhd.FileAttr=0x81ff;
+ NewLhd.FileAttr=0x81b6 & ~mask;
break;
case UNIX:
break;
default:
if ((NewLhd.Flags & LHD_WINDOWMASK)==LHD_DIRECTORY)
- NewLhd.FileAttr=0x41ff;
+ NewLhd.FileAttr=0x41ff & ~mask;
else
- NewLhd.FileAttr=0x81ff;
+ NewLhd.FileAttr=0x81b6 & ~mask;
break;
}
#endif

View File

@ -1,28 +0,0 @@
--- smallfn.c.orig Sat Apr 17 10:53:02 1999
+++ smallfn.c Sun Mar 26 17:40:24 2000
@@ -92,8 +92,12 @@
}
if (Choice==4)
{
+ char *s;
mprintf(MAskNewName);
- gets(Name);
+ *Name = '\0';
+ fgets(Name, NM, stdin);
+ if ((s = strchr(Name, '\n')) != NULL)
+ *s = '\0';
continue;
}
if (Choice==5)
@@ -110,7 +114,10 @@
int GetKey(void)
{
char Str[80];
- gets(Str);
+ *Str = '\0';
+ fgets(Str, 80, stdin);
+ if (*Str == '\n')
+ *Str = '\0';
return(Str[0]);
}