summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick 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)
commit78fa4f798381bb99f7a816691d3663e90e13c1cd (patch)
treefdf7283aca466cef498e0b9c97dcd609d8854295
parent00c097d96a638e3427c176ff657e40b6c01962b0 (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"
-rw-r--r--control3
1 files changed, 2 insertions, 1 deletions
diff --git a/control b/control
index d97e3d6..445cb75 100644
--- a/control
+++ b/control
@@ -1,3 +1,4 @@
Maintainer: Patrick McDermott <patrick.mcdermott@libiquity.com>
-Build-Depends: opkbuild (>= 4.0.2), opkhelper-3.0 (>= 3.0.2), cmake, libubox-dev
+Build-Depends: opkbuild (>= 4.0.2), patch, opkhelper-3.0 (>= 3.0.2),
+ cmake, libubox-dev
Homepage: https://git.openwrt.org/?p=project/opkg-lede.git;a=summary