aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch
diff options
context:
space:
mode:
authorAlejandro del Castillo <alejandro.delcastillo@ni.com>2015-09-01 09:17:53 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-01 21:07:39 +0100
commit1dd2a9ea54f5a5497e23814f144f35ff15430d71 (patch)
tree64bdb7ed617aa956a5759767ebcf089a61a505a4 /meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch
parent947950242376f23808bc5b9c7ddddff46a1f1925 (diff)
downloadopenembedded-core-contrib-1dd2a9ea54f5a5497e23814f144f35ff15430d71.tar.gz
opkg: upgrade to v0.3.0
Changes required: - Rename opkg-cl to opkg - Add libarchive dependency - Drop backport patches - Drop obsolete directory options - Add patch to handle empty index files Based on initial work by Paul Barker. Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> CC: Paul Barker <paul@paulbarker.me.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch')
-rw-r--r--meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch b/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch
new file mode 100644
index 0000000000..dabd196d2c
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch
@@ -0,0 +1,64 @@
+From bd32bb8646459508bb0b0ce54a14bd6fe0e19b75 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Thu, 27 Aug 2015 15:52:16 -0500
+Subject: [PATCH] opkg_archive: add support for empty compressed files
+
+Regression from 0.2.x: opkg used to support empty Package.gz files.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+
+Upstream-Status: Accepted
+---
+ libopkg/opkg_archive.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c
+index be903e4..7e91e48 100644
+--- a/libopkg/opkg_archive.c
++++ b/libopkg/opkg_archive.c
+@@ -121,6 +121,9 @@ static int copy_to_stream(struct archive *a, FILE * stream)
+ int eof;
+ size_t len = EXTRACT_BUFFER_LEN;
+
++ if (archive_format(a) == ARCHIVE_FORMAT_EMPTY)
++ return 0;
++
+ buffer = xmalloc(len);
+
+ while (1) {
+@@ -654,6 +657,13 @@ static struct archive *open_compressed_file(const char *filename)
+ goto err_cleanup;
+ }
+
++ r = archive_read_support_format_empty(ar);
++ if (r != ARCHIVE_OK) {
++ opkg_msg(ERROR, "Empty format not supported: %s\n",
++ archive_error_string(ar));
++ goto err_cleanup;
++ }
++
+ /* Open input file and prepare for reading. */
+ r = archive_read_open_filename(ar, filename, EXTRACT_BUFFER_LEN);
+ if (r != ARCHIVE_OK) {
+@@ -723,6 +733,7 @@ struct opkg_ar *ar_open_compressed_file(const char *filename)
+ {
+ struct opkg_ar *ar;
+ struct archive_entry *entry;
++ int eof;
+
+ ar = (struct opkg_ar *)xmalloc(sizeof(struct opkg_ar));
+
+@@ -737,8 +748,8 @@ struct opkg_ar *ar_open_compressed_file(const char *filename)
+ * header. We skip over this header here so that the caller doesn't need
+ * to know about it.
+ */
+- entry = read_header(ar->ar, NULL);
+- if (!entry)
++ entry = read_header(ar->ar, &eof);
++ if (!entry && !eof)
+ goto err_cleanup;
+
+ return ar;
+--
+1.9.1
+