From 78fa4f798381bb99f7a816691d3663e90e13c1cd Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 06 Apr 2019 15:22:04 -0400 Subject: 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" --- (limited to 'substvars') -- cgit v0.9.1