summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/open_inner.patch
blob: 278e099e3ac13e605eb24a6597e7d7d4e80bcee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From alejandro.delcastillo@ni.com Wed Nov 20 22:35:02 2019
From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
To: <opkg-devel@googlegroups.com>, <richard.purdie@linuxfoundation.org>
CC: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Subject: [opkg][PATCH 2/2] open_inner: add support for empty payloads
Date: Wed, 20 Nov 2019 16:34:48 -0600
Message-ID: <20191120223448.26522-3-alejandro.delcastillo@ni.com>
X-Mailer: git-send-email 2.22.0
In-Reply-To: <20191120223448.26522-1-alejandro.delcastillo@ni.com>
References: <20191120223448.26522-1-alejandro.delcastillo@ni.com>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Support for empty compressed payloads need to be explicitly enabled on
libarchive.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>

Upstream-Status: Backport
---
 libopkg/opkg_archive.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c
index 0e9ccea..f19cece 100644
--- a/libopkg/opkg_archive.c
+++ b/libopkg/opkg_archive.c
@@ -618,6 +618,13 @@ static struct archive *open_inner(struct archive *outer)
         goto err_cleanup;
     }
 
+    r = archive_read_support_format_empty(inner);
+    if (r != ARCHIVE_OK) {
+        opkg_msg(ERROR, "Empty format not supported: %s\n",
+                 archive_error_string(inner));
+        goto err_cleanup;
+    }
+
     r = archive_read_open(inner, data, NULL, inner_read, inner_close);
     if (r != ARCHIVE_OK) {
         opkg_msg(ERROR, "Failed to open inner archive: %s\n",
-- 
2.22.0