diff options
| author | Henning Heinold <heinold@inf.fu-berlin.de> | 2011-11-12 20:58:34 +0100 |
|---|---|---|
| committer | Henning Heinold <heinold@inf.fu-berlin.de> | 2011-11-26 23:41:44 +0100 |
| commit | 57e069cde6617f00ca8834a82c6f360af43d5067 (patch) | |
| tree | 48cbe15e96d217c45acfa64b0c13aad8c6424980 /recipes-core/fastjar | |
| download | meta-java-57e069cde6617f00ca8834a82c6f360af43d5067.tar.gz | |
meta-java: initial commit
* taken over mostly stuff from oe classic
* cleaned up recipes
* added license checksums
* bump icedtea6-native to 1.8.11
* use jamvm from git as native
Diffstat (limited to 'recipes-core/fastjar')
| -rw-r--r-- | recipes-core/fastjar/fastjar.inc | 16 | ||||
| -rw-r--r-- | recipes-core/fastjar/fastjar/jartool.patch | 114 | ||||
| -rw-r--r-- | recipes-core/fastjar/fastjar_0.98.bb | 9 |
3 files changed, 139 insertions, 0 deletions
diff --git a/recipes-core/fastjar/fastjar.inc b/recipes-core/fastjar/fastjar.inc new file mode 100644 index 0000000..f48135d --- /dev/null +++ b/recipes-core/fastjar/fastjar.inc | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | DESCRIPTION = "jar replacement written in C." | ||
| 2 | HOMEPAGE = "http://savannah.nongnu.org/projects/fastjar/" | ||
| 3 | SECTION = "devel" | ||
| 4 | PRIORITY = "optional" | ||
| 5 | LICENSE = "GPLv2" | ||
| 6 | |||
| 7 | DEPENDS = "zlib" | ||
| 8 | |||
| 9 | SRC_URI = "http://download.savannah.nongnu.org/releases/fastjar/fastjar-${PV}.tar.gz" | ||
| 10 | |||
| 11 | inherit autotools | ||
| 12 | |||
| 13 | PACKAGES = "${PN}-grepjar ${PN} ${PN}-dbg ${PN}-doc" | ||
| 14 | FILES_${PN}-grepjar = "${bindir}/grepjar" | ||
| 15 | |||
| 16 | BBCLASSEXTEND = "native" | ||
diff --git a/recipes-core/fastjar/fastjar/jartool.patch b/recipes-core/fastjar/fastjar/jartool.patch new file mode 100644 index 0000000..bb58b27 --- /dev/null +++ b/recipes-core/fastjar/fastjar/jartool.patch | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | Index: fastjar-0.98/jartool.c | ||
| 2 | =================================================================== | ||
| 3 | --- fastjar-0.98.orig/jartool.c 2009-09-07 00:10:47.000000000 +0200 | ||
| 4 | +++ fastjar-0.98/jartool.c 2011-11-10 13:59:01.320585544 +0100 | ||
| 5 | @@ -790,6 +790,7 @@ | ||
| 6 | progname, jarfile); | ||
| 7 | return 1; | ||
| 8 | } | ||
| 9 | + ze->filename[len] = '\0'; | ||
| 10 | len = UNPACK_UB4(header, CEN_EFLEN); | ||
| 11 | len += UNPACK_UB4(header, CEN_COMLEN); | ||
| 12 | if (lseek (fd, len, SEEK_CUR) == -1) | ||
| 13 | @@ -1257,7 +1258,7 @@ | ||
| 14 | exit_on_error("write"); | ||
| 15 | |||
| 16 | /* write the file name to the zip file */ | ||
| 17 | - if (1 == write(jfd, fname, file_name_length)) | ||
| 18 | + if (-1 == write(jfd, fname, file_name_length)) | ||
| 19 | exit_on_error("write"); | ||
| 20 | |||
| 21 | if(verbose){ | ||
| 22 | @@ -1730,7 +1731,17 @@ | ||
| 23 | struct stat sbuf; | ||
| 24 | int depth = 0; | ||
| 25 | |||
| 26 | - tmp_buff = malloc(sizeof(char) * strlen((const char *)filename)); | ||
| 27 | + if(*filename == '/'){ | ||
| 28 | + fprintf(stderr, "Absolute path names are not allowed.\n"); | ||
| 29 | + exit(EXIT_FAILURE); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + tmp_buff = malloc(strlen((const char *)filename)); | ||
| 33 | + | ||
| 34 | + if(tmp_buff == NULL) { | ||
| 35 | + fprintf(stderr, "Out of memory.\n"); | ||
| 36 | + exit(EXIT_FAILURE); | ||
| 37 | + } | ||
| 38 | |||
| 39 | for(;;){ | ||
| 40 | const ub1 *idx = (const unsigned char *)strchr((const char *)start, '/'); | ||
| 41 | @@ -1738,25 +1749,28 @@ | ||
| 42 | if(idx == NULL) | ||
| 43 | break; | ||
| 44 | else if(idx == start){ | ||
| 45 | + tmp_buff[idx - filename] = '/'; | ||
| 46 | start++; | ||
| 47 | continue; | ||
| 48 | } | ||
| 49 | - start = idx + 1; | ||
| 50 | |||
| 51 | - strncpy(tmp_buff, (const char *)filename, (idx - filename)); | ||
| 52 | - tmp_buff[(idx - filename)] = '\0'; | ||
| 53 | + memcpy(tmp_buff + (start - filename), (const char *)start, (idx - start)); | ||
| 54 | + tmp_buff[idx - filename] = '\0'; | ||
| 55 | |||
| 56 | #ifdef DEBUG | ||
| 57 | printf("checking the existance of %s\n", tmp_buff); | ||
| 58 | #endif | ||
| 59 | - if(strcmp(tmp_buff, "..") == 0){ | ||
| 60 | + if(idx - start == 2 && memcmp(start, "..", 2) == 0){ | ||
| 61 | --depth; | ||
| 62 | if (depth < 0){ | ||
| 63 | fprintf(stderr, "Traversal to parent directories during unpacking!\n"); | ||
| 64 | exit(EXIT_FAILURE); | ||
| 65 | } | ||
| 66 | - } else if (strcmp(tmp_buff, ".") != 0) | ||
| 67 | + } else if (idx - start != 1 || *start != '.') | ||
| 68 | ++depth; | ||
| 69 | + | ||
| 70 | + start = idx + 1; | ||
| 71 | + | ||
| 72 | if(stat(tmp_buff, &sbuf) < 0){ | ||
| 73 | if(errno != ENOENT) | ||
| 74 | exit_on_error("stat"); | ||
| 75 | @@ -1765,6 +1779,7 @@ | ||
| 76 | #ifdef DEBUG | ||
| 77 | printf("Directory exists\n"); | ||
| 78 | #endif | ||
| 79 | + tmp_buff[idx - filename] = '/'; | ||
| 80 | continue; | ||
| 81 | }else { | ||
| 82 | fprintf(stderr, "Hmmm.. %s exists but isn't a directory!\n", | ||
| 83 | @@ -1781,10 +1796,11 @@ | ||
| 84 | if(verbose && handle) | ||
| 85 | printf("%10s: %s/\n", "created", tmp_buff); | ||
| 86 | |||
| 87 | + tmp_buff[idx - filename] = '/'; | ||
| 88 | } | ||
| 89 | |||
| 90 | /* only a directory */ | ||
| 91 | - if(strlen((const char *)start) == 0) | ||
| 92 | + if(*start == '\0') | ||
| 93 | dir = TRUE; | ||
| 94 | |||
| 95 | #ifdef DEBUG | ||
| 96 | @@ -1792,7 +1808,7 @@ | ||
| 97 | #endif | ||
| 98 | |||
| 99 | /* If the entry was just a directory, don't write to file, etc */ | ||
| 100 | - if(strlen((const char *)start) == 0) | ||
| 101 | + if(*start == '\0') | ||
| 102 | f_fd = -1; | ||
| 103 | |||
| 104 | free(tmp_buff); | ||
| 105 | @@ -1876,7 +1892,8 @@ | ||
| 106 | exit(EXIT_FAILURE); | ||
| 107 | } | ||
| 108 | |||
| 109 | - close(f_fd); | ||
| 110 | + if (f_fd != -1) | ||
| 111 | + close(f_fd); | ||
| 112 | |||
| 113 | if(verbose && dir == FALSE && handle) | ||
| 114 | printf("%10s: %s\n", | ||
diff --git a/recipes-core/fastjar/fastjar_0.98.bb b/recipes-core/fastjar/fastjar_0.98.bb new file mode 100644 index 0000000..5b5a403 --- /dev/null +++ b/recipes-core/fastjar/fastjar_0.98.bb | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | require fastjar.inc | ||
| 2 | |||
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" | ||
| 4 | |||
| 5 | SRC_URI += "file://jartool.patch" | ||
| 6 | |||
| 7 | SRC_URI[md5sum] = "d2d264d343d4d0e1575832cc1023c3bf" | ||
| 8 | SRC_URI[sha256sum] = "f156abc5de8658f22ee8f08d7a72c88f9409ebd8c7933e9466b0842afeb2f145" | ||
| 9 | |||
