From e21046899102b14e6070398820ab5f84cf272a8b Mon Sep 17 00:00:00 2001 From: kurt Date: Thu, 20 Apr 2006 04:42:38 +0000 Subject: [PATCH] make fastjar list and extract modes recursively deal with directories simialar to Sun's jar. --- lang/kaffe/Makefile | 3 +- .../patch-external_gcc_fastjar_jartool_c | 37 +++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lang/kaffe/Makefile b/lang/kaffe/Makefile index 1cfd6bdcb18..63dd15c5032 100644 --- a/lang/kaffe/Makefile +++ b/lang/kaffe/Makefile @@ -1,10 +1,11 @@ -# $OpenBSD: Makefile,v 1.26 2006/04/11 01:09:44 kurt Exp $ +# $OpenBSD: Makefile,v 1.27 2006/04/20 04:42:38 kurt Exp $ ONLY_FOR_ARCHS= i386 powerpc COMMENT= "kaffe.org's Java JDK1.4 compiler, runtime and libs" DISTNAME= kaffe-1.1.7 +PKGNAME= ${DISTNAME}p0 CATEGORIES= lang diff --git a/lang/kaffe/patches/patch-external_gcc_fastjar_jartool_c b/lang/kaffe/patches/patch-external_gcc_fastjar_jartool_c index 0cd4aeab564..12e4ab87551 100644 --- a/lang/kaffe/patches/patch-external_gcc_fastjar_jartool_c +++ b/lang/kaffe/patches/patch-external_gcc_fastjar_jartool_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-external_gcc_fastjar_jartool_c,v 1.1 2006/04/11 01:09:44 kurt Exp $ +$OpenBSD: patch-external_gcc_fastjar_jartool_c,v 1.2 2006/04/20 04:42:38 kurt Exp $ --- external/gcc/fastjar/jartool.c.orig Tue Jan 3 10:27:01 2006 -+++ external/gcc/fastjar/jartool.c Wed Mar 29 10:03:21 2006 ++++ external/gcc/fastjar/jartool.c Fri Apr 14 01:07:57 2006 @@ -1591,6 +1591,31 @@ int create_central_header(int fd){ return 0; } @@ -47,7 +47,23 @@ $OpenBSD: patch-external_gcc_fastjar_jartool_c,v 1.1 2006/04/11 01:09:44 kurt Ex #ifdef DEBUG printf("filename is %s\n", filename); #endif -@@ -2007,6 +2039,12 @@ int list_jar(int fd, char **files, int f +@@ -1706,11 +1738,13 @@ int extract_jar(int fd, char **files, in + if(file_num > 0){ + handle = FALSE; + +- for(j = 0; j < file_num; j++) +- if(strcmp(files[j], (const char *)filename) == 0){ ++ for(j = 0; j < file_num; j++) { ++ size_t len = strlen(files[j]); ++ if(strncmp(files[j], (const char *)filename, len) == 0){ + handle = TRUE; + break; + } ++ } + } + + if(!handle) +@@ -2007,17 +2041,25 @@ int list_jar(int fd, char **files, int f } filename[fnlen] = '\0'; @@ -60,3 +76,18 @@ $OpenBSD: patch-external_gcc_fastjar_jartool_c,v 1.1 2006/04/11 01:09:44 kurt Ex /* if the user specified a list of files on the command line, we'll only display those, otherwise we'll display everything */ if(file_num > 0){ +- for(j = 0; j < file_num; j++) +- if(strcmp(files[j], (const char *)filename) == 0){ ++ for(j = 0; j < file_num; j++) { ++ size_t len = strlen(files[j]); ++ if(strncmp(files[j], (const char *)filename, len) == 0){ + if(verbose) + printf("%6d %s %s\n", usize, ascii_date, filename); + else + printf("%s\n", filename); + break; + } ++ } + } else { + if(verbose) + printf("%6d %s %s\n", usize, ascii_date, filename);