diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-06 15:22:04 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-06 15:22:04 (EDT) |
commit | 78fa4f798381bb99f7a816691d3663e90e13c1cd (patch) | |
tree | fdf7283aca466cef498e0b9c97dcd609d8854295 /format | |
parent | 00c097d96a638e3427c176ff657e40b6c01962b0 (diff) |
control: B-D on patch
Quoth ob-applypatches:
ob-applypatches: Applying patch "0001-cli-Set-default-conf-file-path-in-build-system.patch"...
patching file CMakeLists.txt
patching file src/opkg-cl.c
ob-applypatches: Applying patch "0002-build-Allow-overriding-opkg-state-dir-prefix.patch"...
patching file CMakeLists.txt
ob-applypatches: Applying patch "0003-cli-Optionally-enforce-argument-to-upgrade-command.patch"...
patching file CMakeLists.txt
patching file libopkg/opkg_cmd.c
patching file src/opkg-cl.c
ob-applypatches: Applying patch "0004-libopkg-Fix-segfault-on-trailing-comma-in-deps.patch"...
patching file libopkg/pkg_depends.c
ob-applypatches: Applying patch "0005-libopkg-Detect-gzipped-pkg-lists-by-magic-number.patch"...
patching file libbb/gzip.h
patching file libopkg/pkg_hash.c
Possibly reversed hunk 1 at 761
Hunk 1 FAILED 99/99.
{
pkg_t *pkg;
FILE *fp;
+ char magic[2];
+ int is_gzip = 0;
char *buf;
const size_t len = 4096;
int ret = 0;
struct gzip_handle zh;
- if (src && src->gzip) {
- fp = gzip_fdopen(&zh, file_name);
- } else {
- fp = fopen(file_name, "r");
- }
-
+ fp = fopen(file_name, "r");
if (fp == NULL) {
opkg_perror(ERROR, "Failed to open %s", file_name);
return -1;
}
+ if (fread(magic, 1, 2, fp) != 2) {
+ opkg_perror(ERROR, "Failed to read %s", file_name);
+ fclose(fp);
+ return -1;
+ }
+ (void)fseek(fp, 0L, SEEK_SET);
+
+ if (src && src->gzip && memcmp(magic, GZIP_MAGIC, 2) == 0) {
+ fclose(fp);
+ fp = gzip_fdopen(&zh, file_name);
+ if (fp == NULL) {
+ opkg_perror(ERROR, "Failed to open %s", file_name);
+ return -1;
+ }
+ is_gzip = 1;
+ }
buf = xmalloc(len);
ob-applypatches: Error: Can't apply patch "0005-libopkg-Detect-gzipped-pkg-lists-by-magic-number.patch"
Diffstat (limited to 'format')
0 files changed, 0 insertions, 0 deletions