[pacman-dev] [PATCH 1/1] libalpm: use archive_write_finish for 2.x compat

Huáng Jùnliàng i at jhuang.me
Thu Feb 8 08:39:17 UTC 2018


The `archive_write_free` is a new function beginning with libarchive 3.0[1]. Since we require libarchive >= 2.8.0, we should use `archive_write_finish` for compatibility.

[1]: Note 5 from https://github.com/libarchive/libarchive/wiki/Examples#a-basic-write-example

Signed-off-by: Huáng Jùnliàng <i at jhuang.me>
---
 lib/libalpm/add.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 0beed01c..b7f47a57 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -131,7 +131,7 @@ static int perform_extraction(alpm_handle_t *handle, struct archive *archive,
 
 	ret = archive_read_extract2(archive, entry, archive_writer);
 
-	archive_write_free(archive_writer);
+	archive_write_finish(archive_writer);
 
 	if(ret == ARCHIVE_WARN && archive_errno(archive) != ENOSPC) {
 		/* operation succeeded but a "non-critical" error was encountered */
-- 
2.16.1


More information about the pacman-dev mailing list