| |
return (retcode);
|
| |
}
|
| |
|
| - |
static void
|
| - |
pack_extract(const char *pack, const char *dbname, const char *dbpath)
|
| - |
{
|
| - |
struct archive *a = NULL;
|
| - |
struct archive_entry *ae = NULL;
|
| - |
|
| - |
if (access(pack, F_OK) != 0)
|
| - |
return;
|
| - |
|
| - |
a = archive_read_new();
|
| - |
archive_read_support_filter_all(a);
|
| - |
archive_read_support_format_tar(a);
|
| - |
if (archive_read_open_filename(a, pack, 4096) != ARCHIVE_OK) {
|
| - |
/* if we can't unpack it it won't be useful for us */
|
| - |
unlink(pack);
|
| - |
archive_read_free(a);
|
| - |
return;
|
| - |
}
|
| - |
|
| - |
while (archive_read_next_header(a, &ae) == ARCHIVE_OK) {
|
| - |
if (strcmp(archive_entry_pathname(ae), dbname) == 0) {
|
| - |
archive_entry_set_pathname(ae, dbpath);
|
| - |
archive_read_extract(a, ae, EXTRACT_ARCHIVE_FLAGS);
|
| - |
break;
|
| - |
}
|
| - |
}
|
| - |
|
| - |
archive_read_free(a);
|
| - |
}
|
| - |
|
| |
struct digest_list_entry {
|
| |
char *origin;
|
| |
char *digest;
|