Track libarchive API change

This commit is contained in:
emaste 2014-12-01 16:10:44 +00:00
parent c145669b3e
commit 5433f2d015

View File

@ -350,12 +350,12 @@ ac_detect_ar(int ifd)
r = -1; r = -1;
if ((a = archive_read_new()) == NULL) if ((a = archive_read_new()) == NULL)
return (0); return (0);
archive_read_support_compression_none(a); archive_read_support_filter_none(a);
archive_read_support_format_ar(a); archive_read_support_format_ar(a);
if (archive_read_open_fd(a, ifd, 10240) == ARCHIVE_OK) if (archive_read_open_fd(a, ifd, 10240) == ARCHIVE_OK)
r = archive_read_next_header(a, &entry); r = archive_read_next_header(a, &entry);
archive_read_close(a); archive_read_close(a);
archive_read_finish(a); archive_read_free(a);
return (r == ARCHIVE_OK); return (r == ARCHIVE_OK);
} }
@ -386,7 +386,7 @@ ac_read_objs(struct elfcopy *ecp, int ifd)
err(EXIT_FAILURE, "lseek failed"); err(EXIT_FAILURE, "lseek failed");
if ((a = archive_read_new()) == NULL) if ((a = archive_read_new()) == NULL)
errx(EXIT_FAILURE, "%s", archive_error_string(a)); errx(EXIT_FAILURE, "%s", archive_error_string(a));
archive_read_support_compression_none(a); archive_read_support_filter_none(a);
archive_read_support_format_ar(a); archive_read_support_format_ar(a);
AC(archive_read_open_fd(a, ifd, 10240)); AC(archive_read_open_fd(a, ifd, 10240));
for(;;) { for(;;) {
@ -435,7 +435,7 @@ ac_read_objs(struct elfcopy *ecp, int ifd)
} }
} }
AC(archive_read_close(a)); AC(archive_read_close(a));
ACV(archive_read_finish(a)); ACV(archive_read_free(a));
} }
static void static void
@ -449,7 +449,7 @@ ac_write_objs(struct elfcopy *ecp, int ofd)
if ((a = archive_write_new()) == NULL) if ((a = archive_write_new()) == NULL)
errx(EXIT_FAILURE, "%s", archive_error_string(a)); errx(EXIT_FAILURE, "%s", archive_error_string(a));
archive_write_set_format_ar_svr4(a); archive_write_set_format_ar_svr4(a);
archive_write_set_compression_none(a); archive_write_add_filter_none(a);
AC(archive_write_open_fd(a, ofd)); AC(archive_write_open_fd(a, ofd));
/* Write the archive symbol table, even if it's empty. */ /* Write the archive symbol table, even if it's empty. */
@ -491,7 +491,7 @@ ac_write_objs(struct elfcopy *ecp, int ofd)
} }
AC(archive_write_close(a)); AC(archive_write_close(a));
ACV(archive_write_finish(a)); ACV(archive_write_free(a));
} }
static void static void