summaryrefslogtreecommitdiffstats
path: root/control
Commit message (Collapse)AuthorAgeFilesLines
* control: B-D on patchPatrick McDermott2019-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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"
* Initial commitPatrick McDermott2019-04-041-0/+3